Fix Wildebeest FEN generation + castling rule
[vchess.git] / client / src / variants / Castle.js
1 import { ChessRules } from "@/base_rules";
2
3 export class CastleRules extends ChessRules {
4
5 getCurrentScore() {
6 const baseScore = super.getCurrentScore();
7 if (baseScore != '*') return baseScore;
8 if (this.castleFlags['b'][0] >= 8) {
9 if (this.getPiece(0,2) == V.KING && this.getPiece(0,3) == V.ROOK)
10 return "0-1";
11 return "1-0";
12 }
13 return '*';
14 }
15
16 };