X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHamilton.js;h=856725c1c0a6be9bf7ad690e03b494d62a91907c;hb=e9437f4b2ee9a40013ee514562f39a36d551faab;hp=f8669b7ed4f5239ad421cd45b5264a1b48313625;hpb=3b98a861b893f0dc8e125c6f4a68faeb075ed56e;p=vchess.git diff --git a/client/src/variants/Hamilton.js b/client/src/variants/Hamilton.js index f8669b7e..856725c1 100644 --- a/client/src/variants/Hamilton.js +++ b/client/src/variants/Hamilton.js @@ -19,10 +19,6 @@ export class HamiltonRules extends ChessRules { return "xx"; } - hoverHighlight() { - return this.movesCount == 0; - } - static board2fen(b) { if (b[0] == 'x') return 'x'; return ChessRules.board2fen(b); @@ -69,6 +65,10 @@ export class HamiltonRules extends ChessRules { return side == this.turn; } + hoverHighlight() { + return this.movesCount == 0; + } + // Initiate the game by choosing a square for the knight: doClick(square) { if (this.movesCount > 0) return null; @@ -86,13 +86,7 @@ export class HamiltonRules extends ChessRules { return [...Array(64).keys()].map(k => { const i = k % 8; const j = (k - i) / 8; - return new Move({ - appear: [ - new PiPo({ x: i, y: j, c: 'w', p: V.KNIGHT }) - ], - vanish: [], - start: { x: -1, y: -1 } - }); + return this.doClick([i, j]); }); } for (let i=0; i<8; i++) {