projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve Paco-Sako rules. Draft Isardam
[vchess.git]
/
client
/
src
/
variants
/
Hamilton.js
diff --git
a/client/src/variants/Hamilton.js
b/client/src/variants/Hamilton.js
index
8c3a1bd
..
88f6713
100644
(file)
--- a/
client/src/variants/Hamilton.js
+++ b/
client/src/variants/Hamilton.js
@@
-2,6
+2,7
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class HamiltonRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class HamiltonRules extends ChessRules {
+
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
@@
-10,10
+11,18
@@
export class HamiltonRules extends ChessRules {
return false;
}
return false;
}
+ get showFirstTurn() {
+ return true;
+ }
+
static get HOLE() {
return "xx";
}
static get HOLE() {
return "xx";
}
+ hoverHighlight(x, y) {
+ return this.movesCount == 0;
+ }
+
static board2fen(b) {
if (b[0] == 'x') return 'x';
return ChessRules.board2fen(b);
static board2fen(b) {
if (b[0] == 'x') return 'x';
return ChessRules.board2fen(b);
@@
-42,7
+51,7
@@
export class HamiltonRules extends ChessRules {
for (let i = 0; i < row.length; i++) {
if (['x'].concat(V.PIECES).includes(row[i].toLowerCase())) sumElts++;
else {
for (let i = 0; i < row.length; i++) {
if (['x'].concat(V.PIECES).includes(row[i].toLowerCase())) sumElts++;
else {
- const num = parseInt(row[i]);
+ const num = parseInt(row[i]
, 10
);
if (isNaN(num)) return false;
sumElts += num;
}
if (isNaN(num)) return false;
sumElts += num;
}
@@
-150,4
+159,5
@@
export class HamiltonRules extends ChessRules {
// First game move:
return "N@" + V.CoordsToSquare(move.end);
}
// First game move:
return "N@" + V.CoordsToSquare(move.end);
}
+
};
};