export const VariantRules = class AtomicRules extends ChessRules {
getEpSquare(moveOrSquare) {
- if (typeof moveOrSquare !== "object" || move.appear.length > 0)
+ if (typeof moveOrSquare !== "object" || moveOrSquare.appear.length > 0)
return super.getEpSquare(moveOrSquare);
// Capturing move: no en-passant
return undefined;
}
getEpSquare(moveOrSquare) {
- if (typeof moveOrSquare !== "object" || move.appear[0].c != 'c')
+ if (typeof moveOrSquare !== "object" || moveOrSquare.appear[0].c != 'c')
return super.getEpSquare(moveOrSquare);
// Checkered move: no en-passant
return undefined;
}
getEpSquare(moveOrSquare) {
- if (typeof moveOrSquare !== "object" || move.vanish.length > 0)
+ if (typeof moveOrSquare !== "object" || moveOrSquare.vanish.length > 0)
return super.getEpSquare(moveOrSquare);
// Landing move: no en-passant
return undefined;
}
getEpSquare(moveOrSquare) {
- if (typeof moveOrSquare !== "object" || move.vanish.length > 0)
+ if (typeof moveOrSquare !== "object" || moveOrSquare.vanish.length > 0)
return super.getEpSquare(moveOrSquare);
// Landing move: no en-passant
return undefined;
export const VariantRules = class RifleRules extends ChessRules {
getEpSquare(moveOrSquare) {
- if (typeof moveOrSquare !== "object" || move.appear.length > 0)
+ if (typeof moveOrSquare !== "object" || moveOrSquare.appear.length > 0)
return super.getEpSquare(moveOrSquare);
// Capturing move: no en-passant
return undefined;