export class CheckeredRules extends ChessRules {
+ static get Options() {
+ return Object.assign(
+ {},
+ ChessRules.Options,
+ {
+ check: [
+ {
+ label: "With switch",
+ defaut: true,
+ variable: "switch"
+ }
+ ]
+ }
+ );
+ }
+
+ static AbbreviateOptions(opts) {
+ return (!opts["switch"] ? "NS" : "");
+ }
+
static board2fen(b) {
const checkered_codes = {
p: "s",
return (b[0] == "c" ? "Checkered/" : "") + b;
}
- static get Options() {
- return Object.assign(
- {},
- ChessRules.Options,
- {
- check: [
- {
- label: "With switch",
- defaut: true,
- variable: "switch"
- }
- ]
- }
- );
- }
-
- static AbbreviateOptions(opts) {
- return (!opts["switch"] ? "NS" : "");
- }
-
setOtherVariables(fen) {
super.setOtherVariables(fen);
// Local stack of non-capturing checkered moves:
isAttackedByKnight(sq, colors) {
return this.isAttackedBySlideNJump(
- sq,
- colors,
- V.KNIGHT,
- V.steps[V.KNIGHT],
- "oneStep"
- );
+ sq, colors, V.KNIGHT, V.steps[V.KNIGHT], "oneStep");
}
isAttackedByBishop(sq, colors) {
isAttackedByQueen(sq, colors) {
return this.isAttackedBySlideNJump(
- sq,
- colors,
- V.QUEEN,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP])
- );
+ sq, colors, V.QUEEN, V.steps[V.ROOK].concat(V.steps[V.BISHOP]));
}
isAttackedByKing(sq, colors) {
return this.isAttackedBySlideNJump(
- sq,
- colors,
- V.KING,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- "oneStep"
+ sq, colors, V.KING,
+ V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep"
);
}