-
- // TODO::::::::
- // All possible moves from selected square
- // TODO: generalize usage if arg "color" (e.g. Checkered)
- getPotentialMovesFrom([x, y], color) {
- if (this.subTurnTeleport == 2)
- return [];
- if (typeof x == "string")
- return this.getDropMovesFrom([x, y]);
- if (this.isImmobilized([x, y]))
- return [];
- const piece = this.getPieceType(x, y);
- let moves = this.getPotentialMovesOf(piece, [x, y]);
- if (piece == "p" && this.hasEnpassant && this.epSquare)
- Array.prototype.push.apply(moves, this.getEnpassantCaptures([x, y]));
- if (this.isKing(0, 0, piece) && this.hasCastle)
- Array.prototype.push.apply(moves, this.getCastleMoves([x, y]));
- return this.postProcessPotentialMoves(moves);
+ getSentryPushes(x, y) {
+ // TODO: return all squares piece on x, y can be pushed to
+ // Simple