(type: TheCaveMoveType)
| 257 | } |
| 258 | |
| 259 | private move(type: TheCaveMoveType): void{ |
| 260 | // If we made more than 12 moves and there's no pattern, we reach the exit |
| 261 | if(this.lastMoves.length > 12 && this.pattern == null){ |
| 262 | this.goToTheCaveExit(); |
| 263 | } |
| 264 | |
| 265 | // If there's a pattern, we call its move method |
| 266 | if(this.pattern != null) this.pattern.move(type); |
| 267 | |
| 268 | // Add this move to the last moves |
| 269 | this.lastMoves.push(type); |
| 270 | |
| 271 | // Create the new way |
| 272 | this.createWay(type); |
| 273 | |
| 274 | // Update |
| 275 | this.update(); |
| 276 | this.getGame().updatePlace(); |
| 277 | } |
| 278 | |
| 279 | private update(): void{ |
| 280 | // Erase everything |
nothing calls this directly
no test coverage detected