X-Git-Url: https://git.auder.net/images/pieces/current/gitweb.js?a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=293e933d3e8db4b2101a3a334ad5af08d59f7808;hb=7c4828992dc2b9e1ea60cd8db18c4c51dbd25fc4;hp=2c2b705c4c71b90fc052d1018d3a68c80125ca52;hpb=9a1e3abe33fff07218b17c7c799eb622a730b7c7;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 2c2b705c..293e933d 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -112,6 +112,11 @@ export const ChessRules = class ChessRules { return false; } + // Some games are drawn unusually (bottomr right corner is black) + static get DarkBottomRight() { + return false; + } + // Some variants require lines drawing static get Lines() { if (V.Monochrome) { @@ -650,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 }