projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Fullcavalry + complete rules. Also complete Atomic2 rules
[vchess.git]
/
client
/
src
/
variants
/
Twokings.js
diff --git
a/client/src/variants/Twokings.js
b/client/src/variants/Twokings.js
index
ce30d65
..
a5bd76a
100644
(file)
--- a/
client/src/variants/Twokings.js
+++ b/
client/src/variants/Twokings.js
@@
-2,6
+2,7
@@
import { ChessRules } from "@/base_rules";
import { CoregalRules } from "@/variants/Coregal";
export class TwokingsRules extends CoregalRules {
import { CoregalRules } from "@/variants/Coregal";
export class TwokingsRules extends CoregalRules {
+
static get PawnSpecs() {
return Object.assign(
{},
static get PawnSpecs() {
return Object.assign(
{},
@@
-21,7
+22,7
@@
export class TwokingsRules extends CoregalRules {
if (['K','k'].includes(row[i])) kings[row[i]]++;
if (V.PIECES.includes(row[i].toLowerCase())) sumElts++;
else {
if (['K','k'].includes(row[i])) kings[row[i]]++;
if (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;
}
@@
-34,9
+35,10
@@
export class TwokingsRules extends CoregalRules {
}
// Not scanning king positions. In this variant, scan the board everytime.
}
// Not scanning king positions. In this variant, scan the board everytime.
- scanKings(
fen
) {}
+ scanKings() {}
- getCheckSquares(color) {
+ getCheckSquares() {
+ const color = this.turn;
let squares = [];
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
let squares = [];
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
@@
-100,6
+102,11
@@
export class TwokingsRules extends CoregalRules {
);
}
);
}
+ getPotentialQueenMoves(sq) {
+ return this.getSlideNJumpMoves(sq,
+ V.steps[V.ROOK].concat(V.steps[V.BISHOP]));
+ }
+
underCheck(color) {
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
underCheck(color) {
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
@@
-122,4
+129,5
@@
export class TwokingsRules extends CoregalRules {
}
postUndo() {}
}
postUndo() {}
+
};
};