projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Rococo
[vchess.git]
/
client
/
src
/
variants
/
Dark.js
diff --git
a/client/src/variants/Dark.js
b/client/src/variants/Dark.js
index
65934e6
..
e7ba40c
100644
(file)
--- a/
client/src/variants/Dark.js
+++ b/
client/src/variants/Dark.js
@@
-3,6
+3,7
@@
import { ArrayFun } from "@/utils/array";
import { randInt } from "@/utils/alea";
export class DarkRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class DarkRules extends ChessRules {
+
// Analyse in Dark mode makes no sense
static get CanAnalyze() {
return false;
// Analyse in Dark mode makes no sense
static get CanAnalyze() {
return false;
@@
-82,6
+83,11
@@
export class DarkRules extends ChessRules {
}
}
}
}
+ // To always allow castling:
+ isAttacked() {
+ return false;
+ }
+
filterValid(moves) {
// Used in the interface
return moves;
filterValid(moves) {
// Used in the interface
return moves;
@@
-269,4
+275,5
@@
export class DarkRules extends ChessRules {
candidates.push(j);
return moves[candidates[randInt(candidates.length)]];
}
candidates.push(j);
return moves[candidates[randInt(candidates.length)]];
}
+
};
};