projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Kar-Ouk
[vchess.git]
/
client
/
src
/
variants
/
Horde.js
diff --git
a/client/src/variants/Horde.js
b/client/src/variants/Horde.js
index
6305c41
..
33157c9
100644
(file)
--- a/
client/src/variants/Horde.js
+++ b/
client/src/variants/Horde.js
@@
-1,6
+1,7
@@
import { ChessRules } from "@/base_rules";
export class HordeRules extends ChessRules {
import { ChessRules } from "@/base_rules";
export class HordeRules extends ChessRules {
+
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
@@
-24,7
+25,7
@@
export class HordeRules extends ChessRules {
}
sumElts++;
} else {
}
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;
}
@@
-51,8
+52,8
@@
export class HordeRules extends ChessRules {
return super.filterValid(moves);
}
return super.filterValid(moves);
}
- getCheckSquares(
color
) {
- if (
color
== 'w') return [];
+ getCheckSquares() {
+ if (
this.turn
== 'w') return [];
return (
this.underCheck('b')
? [JSON.parse(JSON.stringify(this.kingPos['b']))]
return (
this.underCheck('b')
? [JSON.parse(JSON.stringify(this.kingPos['b']))]
@@
-80,4
+81,5
@@
export class HordeRules extends ChessRules {
// From black side, just run usual checks:
return super.getCurrentScore();
}
// From black side, just run usual checks:
return super.getCurrentScore();
}
+
};
};