class MagneticRules extends ChessRules
{
- getEpSquare(move)
- {
- return undefined; //no en-passant
- }
+ static get HasEnpassant() { return false; }
getPotentialMovesFrom([x,y])
{
this.play(move);
// The only way to be "under check" is to have lost the king (thus game over)
let res = this.kingPos[c][0] < 0
- ? [ JSON.parse(JSON.stringify(saveKingPos)) ]
- : [ ];
+ ? [JSON.parse(JSON.stringify(saveKingPos))]
+ : [];
this.undo(move);
return res;
}
return this.turn == "w" ? "0-1" : "1-0";
}
- static get THRESHOLD_MATE() {
+ static get THRESHOLD_MATE()
+ {
return 500; //checkmates evals may be slightly below 1000
}
}
+
+const VariantRules = MagneticRules;