1 import { ChessRules
, Move
, PiPo
} from "@/base_rules";
2 import { Atomic1Rules
} from "@/variants/Atomic1";
4 export class Atomic2Rules
extends Atomic1Rules
{
6 getPotentialMovesFrom([x
, y
]) {
7 if (this.movesCount
== 0) {
8 if ([1, 6].includes(x
)) {
9 const c
= this.getColor(x
, y
);
14 new PiPo({ x: x
, y: y
, p: V
.PAWN
, c: c
})
16 start: { x: x
, y: y
},
23 return super.getPotentialMovesFrom([x
, y
]);
26 hoverHighlight(x
, y
) {
27 return this.movesCount
== 0 && [1, 6].includes(x
);
31 if (this.movesCount
>= 1) return null;
32 const [x
, y
] = [square
[0], square
[1]];
33 if (![1, 6].includes(x
)) return null;
40 c: this.getColor(x
, y
),
44 start: { x: x
, y: y
},
50 if (move.appear
.length
== 0 && move.vanish
.length
== 1)
52 return V
.CoordsToSquare(move.start
) + "X";
53 return super.getNotation(move);