X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=0549139877e5ad5ebb1ed6bc54b318febb4ce212;hb=c11afcdfa8678a27ea6c0822f6d3fef83967701b;hp=0a68127f2ae48b75d9a04c05be020787ea8d97e6;hpb=3208c66750e6a677b407267c44c35a395208c196;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 0a68127f..05491398 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -22,8 +22,8 @@ export const Move = class Move { constructor(o) { this.appear = o.appear; this.vanish = o.vanish; - this.start = o.start ? o.start : { x: o.vanish[0].x, y: o.vanish[0].y }; - this.end = o.end ? o.end : { x: o.appear[0].x, y: o.appear[0].y }; + this.start = o.start || { x: o.vanish[0].x, y: o.vanish[0].y }; + this.end = o.end || { x: o.appear[0].x, y: o.appear[0].y }; } }; @@ -136,6 +136,11 @@ export const ChessRules = class ChessRules { return false; } + // At some stages, some games could wait clicks only: + onlyClick() { + return false; + } + // Some variants use click infos: doClick() { return null; @@ -662,7 +667,7 @@ export const ChessRules = class ChessRules { case V.QUEEN: return this.getPotentialQueenMoves(sq); case V.KING: return this.getPotentialKingMoves(sq); } - return []; //never reached + return []; //never reached (but some variants may use it: Bario...) } // Build a regular move from its initial and destination squares.