1 import ChessRules
from "/base_rules.js";
3 export default class MadrasiRules
extends ChessRules
{
7 select: C
.Options
.select
,
14 ].concat(C
.Options
.check
),
15 styles: C
.Options
.styles
.filter(s
=> s
!= "madrasi")
20 o
.options
["madrasi"] = true;
24 underCheck([x
, y
], color
) {
25 if (this.options
["rexincl"]) {
26 // If Rex Inclusive, kings do not check each other:
27 // we just replace it very temporarily.
28 const [ox
, oy
] = this.searchKingPos(color
);
29 const saveOppKing
= this.board
[ox
][oy
];
30 this.board
[ox
][oy
] = C
.GetOppCol(color
) + "q"; //arbitrary
31 const res
= super.underCheck([x
, y
], color
);
32 this.board
[ox
][oy
] = saveOppKing
;
35 return super.underCheck([x
, y
], color
);