1 import { ChessRules
} from "@/base_rules";
3 export class TitanRules
extends ChessRules
{
4 // Idea: yellow = bishop, orange = knight (for white)
5 // and, red = bishop + purple = knight (black side)
6 // (avoid using a bigger board, or complicated drawings)
8 // Decode if normal piece, or + bishop or knight
10 const piece
= this.board
[i
][j
].charAt(1);
11 if (ChessRules
.PIECES
.includes(piece
)) return piece
;
32 // TODO: subtelty, castle forbidden if
34 // Code: a/c = bishop + knight/bishop j/l for king,
35 // m/o for knight, s/t for queen, u/v for rook
36 static get AUGMENTED_PIECES() {
51 // Decode above notation into additional piece
52 getExtraPiece(symbol
) {
53 if (['a','j','m','s','u'].includes(symbol
))
58 // If piece not in usual list, bishop or knight appears.
59 getPotentialMovesFrom([x
, y
]) {
60 let moves
= super.getPotentialMovesFrom(sq
);
61 const color
= this.turn
;
63 // treat castle case here (both pieces appear!)
65 V
.AUGMENTED_PIECES
.includes(this.board
[x
][y
][1]) &&
66 ((color
== 'w' && x
== 7) || (color
== "b" && x
== 0))
68 const newPiece
= this.getExtraPiece(this.board
[x
][y
][1]);
83 // TODO: special case of move 1 = choose squares, knight first, then bishop