Commit | Line | Data |
---|---|---|
2bb4666e BA |
1 | import { ChessRules } from "@/base_rules"; |
2 | ||
3 | export class CastleRules extends ChessRules { | |
7e8a7ea1 | 4 | |
2bb4666e BA |
5 | getCurrentScore() { |
6 | const baseScore = super.getCurrentScore(); | |
7 | if (baseScore != '*') return baseScore; | |
aafc804f BA |
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 | } | |
2bb4666e BA |
13 | return '*'; |
14 | } | |
7e8a7ea1 | 15 | |
2bb4666e | 16 | }; |