projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base_rules.js refactoring. draft state (untested)
[xogo.git]
/
variants
/
Allmate
/
class.js
diff --git
a/variants/Allmate/class.js
b/variants/Allmate/class.js
index
8c5a92c
..
8d31649
100644
(file)
--- a/
variants/Allmate/class.js
+++ b/
variants/Allmate/class.js
@@
-18,9
+18,6
@@
export default class AllmateRules extends ChessRules {
get hasEnpassant() {
return false;
}
get hasEnpassant() {
return false;
}
- get hasMoveStack() {
- return true;
- }
setOtherVariables(fenParsed) {
super.setOtherVariables(fenParsed);
setOtherVariables(fenParsed) {
super.setOtherVariables(fenParsed);
@@
-62,7
+59,7
@@
export default class AllmateRules extends ChessRules {
// is piece on square x,y mated by color?
isMated(x, y, color) {
const myColor = C.GetOppCol(color);
// is piece on square x,y mated by color?
isMated(x, y, color) {
const myColor = C.GetOppCol(color);
- if (!
this.underChe
ck([x, y], color))
+ if (!
super.underAtta
ck([x, y], color))
return false;
for (let i=0; i<this.size.x; i++) {
for (let j=0; j<this.size.y; j++) {
return false;
for (let i=0; i<this.size.x; i++) {
for (let j=0; j<this.size.y; j++) {
@@
-74,7
+71,7
@@
export default class AllmateRules extends ChessRules {
if (i == x && j == y) {
// The mated-candidate has moved itself
testSquare = [move.end.x, move.end.y]; }
if (i == x && j == y) {
// The mated-candidate has moved itself
testSquare = [move.end.x, move.end.y]; }
- const res = this.under
Che
ck(testSquare, color);
+ const res = this.under
Atta
ck(testSquare, color);
this.undoOnBoard(move);
if (!res)
return false;
this.undoOnBoard(move);
if (!res)
return false;
@@
-85,9
+82,8
@@
export default class AllmateRules extends ChessRules {
return true;
}
return true;
}
- // No "under check" conditions in castling
- getCastleMoves(sq) {
- return super.getCastleMoves(sq, null, "castleInCheck");
+ underCheck([x, y], oppCol) {
+ return false; //not relevant here
}
filterValid(moves) {
}
filterValid(moves) {