X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FDark.js;h=e7ba40cea601c1101d77712ae728748513505240;hb=HEAD;hp=65934e6914a46ff0d206d53cc0aa8921e6a7503e;hpb=737a5dafb39740ebe304b8d0a82df85070def571;p=vchess.git diff --git a/client/src/variants/Dark.js b/client/src/variants/Dark.js index 65934e69..e7ba40ce 100644 --- 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 { + // 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; @@ -269,4 +275,5 @@ export class DarkRules extends ChessRules { candidates.push(j); return moves[candidates[randInt(candidates.length)]]; } + };