X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FLoser.js;h=936c2590254cce5f1a764fe14a71e1909f098e14;hb=c148615e9e7296869f95895ef434fd8371d637c2;hp=0c484c128fde922b1201cc8806a26770e7f109da;hpb=a6abf094c35a26019e47fea21302c4be32ff030b;p=vchess.git diff --git a/public/javascripts/variants/Loser.js b/public/javascripts/variants/Loser.js index 0c484c12..936c2590 100644 --- a/public/javascripts/variants/Loser.js +++ b/public/javascripts/variants/Loser.js @@ -2,12 +2,15 @@ class LoserRules extends ChessRules { initVariables(fen) { - // No castling, hence no flags const epSq = this.moves.length > 0 ? this.getEpSquare(this.lastMove) : undefined; this.epSquares = [ epSq ]; } - setFlags(fen) { } + setFlags(fen) + { + // No castling, hence no flags; but flags defined for compatibility + this.castleFlags = { "w":[false,false], "b":[false,false] }; + } getPotentialPawnMoves([x,y]) { @@ -102,20 +105,14 @@ class LoserRules extends ChessRules return []; } - play(move, ingame) - { - if (!!ingame) - move.notation = this.getNotation(move); - this.moves.push(move); - this.epSquares.push( this.getEpSquare(move) ); - VariantRules.PlayOnBoard(this.board, move); - } + // Unused: + updateVariables(move) { } + unupdateVariables(move) { } + parseFlags(flags) { } - undo(move) + getFlagsFen() { - VariantRules.UndoOnBoard(this.board, move); - this.epSquares.pop(); - this.moves.pop(); + return ""; } checkGameEnd()