projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Antiking 1 notation
[vchess.git]
/
client
/
src
/
variants
/
Hidden.js
diff --git
a/client/src/variants/Hidden.js
b/client/src/variants/Hidden.js
index
5ccc3d7
..
8a5858e
100644
(file)
--- a/
client/src/variants/Hidden.js
+++ b/
client/src/variants/Hidden.js
@@
-7,6
+7,10
@@
export const VariantRules = class HiddenRules extends ChessRules {
return false;
}
return false;
}
+ static get HasCastle() {
+ return false;
+ }
+
static get HasEnpassant() {
return false;
}
static get HasEnpassant() {
return false;
}
@@
-16,9
+20,9
@@
export const VariantRules = class HiddenRules extends ChessRules {
return false;
}
return false;
}
- // Moves are revealed only when game ends
+ // Moves are revealed only when game ends
, but are highlighted on board
static get ShowMoves() {
static get ShowMoves() {
- return "
none
";
+ return "
highlight
";
}
static get HIDDEN_DECODE() {
}
static get HIDDEN_DECODE() {
@@
-74,7
+78,7
@@
export const VariantRules = class HiddenRules extends ChessRules {
}
// Scan board for kings positions (no castling)
}
// Scan board for kings positions (no castling)
- scanKings
Rooks
(fen) {
+ scanKings(fen) {
this.kingPos = { w: [-1, -1], b: [-1, -1] };
const fenRows = V.ParseFen(fen).position.split("/");
for (let i = 0; i < fenRows.length; i++) {
this.kingPos = { w: [-1, -1], b: [-1, -1] };
const fenRows = V.ParseFen(fen).position.split("/");
for (let i = 0; i < fenRows.length; i++) {
@@
-143,16
+147,6
@@
export const VariantRules = class HiddenRules extends ChessRules {
return mv;
}
return mv;
}
- // What are the king moves from square x,y ?
- getPotentialKingMoves(sq) {
- // No castling:
- return this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- "oneStep"
- );
- }
-
filterValid(moves) {
return moves;
}
filterValid(moves) {
return moves;
}
@@
-225,8
+219,8
@@
export const VariantRules = class HiddenRules extends ChessRules {
return [];
}
return [];
}
-
updateVariables
(move) {
- super.
updateVariables
(move);
+
postPlay
(move) {
+ super.
postPlay
(move);
if (
move.vanish.length >= 2 &&
[V.KING,V.HIDDEN_CODE[V.KING]].includes(move.vanish[1].p)
if (
move.vanish.length >= 2 &&
[V.KING,V.HIDDEN_CODE[V.KING]].includes(move.vanish[1].p)
@@
-236,8
+230,8
@@
export const VariantRules = class HiddenRules extends ChessRules {
}
}
}
}
-
unupdateVariables
(move) {
- super.
unupdateVariables
(move);
+
postUndo
(move) {
+ super.
postUndo
(move);
const c = move.vanish[0].c;
const oppCol = V.GetOppCol(c);
if (this.kingPos[oppCol][0] < 0)
const c = move.vanish[0].c;
const oppCol = V.GetOppCol(c);
if (this.kingPos[oppCol][0] < 0)