+ getEnpassantCaptures([x, y], shift) {
+ const Lep = this.epSquares.length;
+ const epSquare = this.epSquares[Lep - 1]; //always at least one element
+ if (
+ !!epSquare &&
+ epSquare[0].x == x + shift &&
+ epSquare[0].y == y
+ ) {
+ let enpassantMove = this.getBasicMove([x, y], [x + shift, y]);
+ enpassantMove.vanish.push({
+ x: x,
+ y: epSquare[1],
+ p: "p",
+ c: this.getColor(x, epSquare[1])
+ });
+ return [enpassantMove];
+ }
+ return [];
+ }
+