X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=293e933d3e8db4b2101a3a334ad5af08d59f7808;hp=aa49f91fa1cbc02bd8476a6be8c8f7b88118872c;hb=dbc79ee67847c36aad6b640b15d25d6fb7f361e5;hpb=95bc4bf5248120712946500416543bbfc6b7ae85 diff --git a/client/src/base_rules.js b/client/src/base_rules.js index aa49f91f..293e933d 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -655,18 +655,12 @@ export const ChessRules = class ChessRules { // All possible moves from selected square getPotentialMovesFrom([x, y]) { switch (this.getPiece(x, y)) { - case V.PAWN: - return this.getPotentialPawnMoves([x, y]); - case V.ROOK: - return this.getPotentialRookMoves([x, y]); - case V.KNIGHT: - return this.getPotentialKnightMoves([x, y]); - case V.BISHOP: - return this.getPotentialBishopMoves([x, y]); - case V.QUEEN: - return this.getPotentialQueenMoves([x, y]); - case V.KING: - return this.getPotentialKingMoves([x, y]); + case V.PAWN: return this.getPotentialPawnMoves([x, y]); + case V.ROOK: return this.getPotentialRookMoves([x, y]); + case V.KNIGHT: return this.getPotentialKnightMoves([x, y]); + case V.BISHOP: return this.getPotentialBishopMoves([x, y]); + case V.QUEEN: return this.getPotentialQueenMoves([x, y]); + case V.KING: return this.getPotentialKingMoves([x, y]); } return []; //never reached }