import { ChessRules, PiPo } from "@/base_rules";
export class SchessRules extends ChessRules {
+
static get PawnSpecs() {
return Object.assign(
{},
const fenParsed = V.ParseFen(fen);
this.pocket = {
"w": {
- h: parseInt(fenParsed.pocket[0]),
- e: parseInt(fenParsed.pocket[1])
+ h: parseInt(fenParsed.pocket[0], 10),
+ e: parseInt(fenParsed.pocket[1], 10)
},
"b": {
- h: parseInt(fenParsed.pocket[2]),
- e: parseInt(fenParsed.pocket[3])
+ h: parseInt(fenParsed.pocket[2], 10),
+ e: parseInt(fenParsed.pocket[3], 10)
}
};
}
(
m.appear.length == shift+1 ||
// Special castle case: is initial king square free?
- ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[0].y)
+ ![m.appear[shift].y, m.appear[shift+1].y]
+ .includes(m.vanish[0].y)
)
) {
let pMove = JSON.parse(JSON.stringify(m));
if (
m.appear.length >= 2 + shift &&
m.vanish.length == 2 &&
- ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[1].y)
+ ![m.appear[shift].y, m.appear[shift+1].y]
+ .includes(m.vanish[1].y)
) {
// Special castle case: rook flag was necessarily on
let pMove = JSON.parse(JSON.stringify(m));
([V.HAWK, V.ELEPHANT, V.NOTHING].includes(move.appear[0].p) ? 1 : 0);
this.kingPos[color][0] = move.appear[shift].x;
this.kingPos[color][1] = move.appear[shift].y;
- return;
}
this.updateCastleFlags(move, piece);
}
return super.getNotation(move);
}
+
};