1 import { ChessRules
} from "@/base_rules";
2 import { BerolinaRules
} from "@/variants/Berolina";
4 export class GridolinaRules
extends BerolinaRules
{
16 static OnDifferentGrids([x1
, y1
], [x2
, y2
]) {
18 Math
.abs(Math
.floor(x1
/ 2) - Math
.floor(x2
/ 2)) >= 1 ||
19 Math
.abs(Math
.floor(y1
/ 2) - Math
.floor(y2
/ 2)) >= 1
23 canTake([x1
, y1
], [x2
, y2
]) {
25 V
.OnDifferentGrids([x1
, y1
], [x2
, y2
]) &&
26 super.canTake([x1
, y1
], [x2
, y2
])
30 getPotentialMovesFrom([x
, y
]) {
32 super.getPotentialMovesFrom([x
, y
]).filter(m
=> {
33 return V
.OnDifferentGrids([x
, y
], [m
.end
.x
, m
.end
.y
]);