X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FEightpieces.js;h=c380610c159c25f5fde4b013a9e18f67ebb47b66;hb=f52671e5b5b50b1421474f27dc9c18f701b559f3;hp=1fbc5d0b0ce172b86fa27538836c7c75f68c2bcf;hpb=7301aa5ff93c6b0cf6b2c41a24d552597b689693;p=vchess.git diff --git a/client/src/variants/Eightpieces.js b/client/src/variants/Eightpieces.js index 1fbc5d0b..c380610c 100644 --- a/client/src/variants/Eightpieces.js +++ b/client/src/variants/Eightpieces.js @@ -246,45 +246,6 @@ export class EightpiecesRules extends ChessRules { return null; } - // Because of the lancers, getPiece() could be wrong: - // use board[x][y][1] instead (always valid). - getBasicMove([sx, sy], [ex, ey], tr) { - const initColor = this.getColor(sx, sy); - const initPiece = this.board[sx][sy].charAt(1); - let mv = new Move({ - appear: [ - new PiPo({ - x: ex, - y: ey, - c: tr ? tr.c : initColor, - p: tr ? tr.p : initPiece - }) - ], - vanish: [ - new PiPo({ - x: sx, - y: sy, - c: initColor, - p: initPiece - }) - ] - }); - - // The opponent piece disappears if we take it - if (this.board[ex][ey] != V.EMPTY) { - mv.vanish.push( - new PiPo({ - x: ex, - y: ey, - c: this.getColor(ex, ey), - p: this.board[ex][ey].charAt(1) - }) - ); - } - - return mv; - } - canIplay(side, [x, y]) { return ( (this.subTurn == 1 && this.turn == side && this.getColor(x, y) == side)