- getPotentialPawnMoves([x, y]) {
- let moves = super.getPotentialPawnMoves([x, y]);
- // Add "zen" captures
- Array.prototype.push.apply(moves, this.findCaptures([x, y]));
- return moves;
- }
-
- getPotentialRookMoves(sq) {
- let noCaptures = this.getSlideNJumpMoves(sq, V.steps[V.ROOK]);
- let captures = this.findCaptures(sq);
- return noCaptures.concat(captures);
- }
-
- getPotentialKnightMoves(sq) {
- let noCaptures = this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT], "oneStep");
- let captures = this.findCaptures(sq);
- return noCaptures.concat(captures);
- }
-
- getPotentialBishopMoves(sq) {
- let noCaptures = this.getSlideNJumpMoves(sq, V.steps[V.BISHOP]);
- let captures = this.findCaptures(sq);
- return noCaptures.concat(captures);
- }
-
- getPotentialQueenMoves(sq) {
- let noCaptures = this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP])
- );
- let captures = this.findCaptures(sq);
- return noCaptures.concat(captures);
- }
-
- getPotentialKingMoves(sq) {
- // Initialize with normal moves
- let noCaptures = this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- "oneStep"
- );
- let captures = this.findCaptures(sq);
- return noCaptures.concat(captures).concat(this.getCastleMoves(sq));