projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Minixiangqi, fix a few typos
[vchess.git]
/
client
/
src
/
variants
/
Synchrone.js
diff --git
a/client/src/variants/Synchrone.js
b/client/src/variants/Synchrone.js
index
0792901
..
365dd9a
100644
(file)
--- a/
client/src/variants/Synchrone.js
+++ b/
client/src/variants/Synchrone.js
@@
-2,6
+2,7
@@
import { ChessRules } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class SynchroneRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class SynchroneRules extends ChessRules {
+
static get CanAnalyze() {
return false;
}
static get CanAnalyze() {
return false;
}
@@
-10,6
+11,10
@@
export class SynchroneRules extends ChessRules {
return "byrow";
}
return "byrow";
}
+ static get SomeHiddenMoves() {
+ return true;
+ }
+
static IsGoodFen(fen) {
if (!ChessRules.IsGoodFen(fen)) return false;
const fenParsed = V.ParseFen(fen);
static IsGoodFen(fen) {
if (!ChessRules.IsGoodFen(fen)) return false;
const fenParsed = V.ParseFen(fen);
@@
-74,7
+79,6
@@
export class SynchroneRules extends ChessRules {
: null;
}
: null;
}
- // After undo(): no need to re-set INIT_COL_KING
scanKings() {
this.kingPos = { w: [-1, -1], b: [-1, -1] };
for (let i = 0; i < V.size.x; i++) {
scanKings() {
this.kingPos = { w: [-1, -1], b: [-1, -1] };
for (let i = 0; i < V.size.x; i++) {
@@
-433,7
+437,8
@@
export class SynchroneRules extends ChessRules {
} else this.whiteMove = move.whiteMove;
}
} else this.whiteMove = move.whiteMove;
}
- getCheckSquares(color) {
+ getCheckSquares() {
+ const color = this.turn;
if (color == 'b') {
// kingPos must be reset for appropriate highlighting:
var lastMove = JSON.parse(JSON.stringify(this.whiteMove));
if (color == 'b') {
// kingPos must be reset for appropriate highlighting:
var lastMove = JSON.parse(JSON.stringify(this.whiteMove));
@@
-511,4
+516,5
@@
export class SynchroneRules extends ChessRules {
V.CoordsToSquare(move.end)
);
}
V.CoordsToSquare(move.end)
);
}
+
};
};