projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix display of Hiddenqueen diags in corr games
[vchess.git]
/
client
/
src
/
variants
/
Checkered.js
diff --git
a/client/src/variants/Checkered.js
b/client/src/variants/Checkered.js
index
5036a82
..
aac3e02
100644
(file)
--- a/
client/src/variants/Checkered.js
+++ b/
client/src/variants/Checkered.js
@@
-2,6
+2,26
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
export class CheckeredRules extends ChessRules {
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",
static board2fen(b) {
const checkered_codes = {
p: "s",
@@
-41,26
+61,6
@@
export class CheckeredRules extends ChessRules {
return (b[0] == "c" ? "Checkered/" : "") + b;
}
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:
setOtherVariables(fen) {
super.setOtherVariables(fen);
// Local stack of non-capturing checkered moves:
@@
-433,12
+433,7
@@
export class CheckeredRules extends ChessRules {
isAttackedByKnight(sq, colors) {
return this.isAttackedBySlideNJump(
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) {
}
isAttackedByBishop(sq, colors) {
@@
-448,20
+443,13
@@
export class CheckeredRules extends ChessRules {
isAttackedByQueen(sq, colors) {
return this.isAttackedBySlideNJump(
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(
}
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"
);
}
);
}