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