projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve buttons styles on game page
[vchess.git]
/
public
/
javascripts
/
variants
/
Loser.js
diff --git
a/public/javascripts/variants/Loser.js
b/public/javascripts/variants/Loser.js
index
0c484c1
..
936c259
100644
(file)
--- a/
public/javascripts/variants/Loser.js
+++ b/
public/javascripts/variants/Loser.js
@@
-2,12
+2,15
@@
class LoserRules extends ChessRules
{
initVariables(fen)
{
{
initVariables(fen)
{
- // No castling, hence no flags
const epSq = this.moves.length > 0 ? this.getEpSquare(this.lastMove) : undefined;
this.epSquares = [ epSq ];
}
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])
{
getPotentialPawnMoves([x,y])
{
@@
-102,20
+105,14
@@
class LoserRules extends ChessRules
return [];
}
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()
}
checkGameEnd()