- for (let s of [[shiftX, 0], [0, 1], [0, -1]]) {
- const [i, j] = [x + s[0], y + s[1]];
- if (
- this.board[i][j] != V.EMPTY &&
- this.getColor(i, j) == color &&
- this.getPiece(i, j) == V.PAWN
- ) {
- return true;
- }
- }
- return false;
+ return super.isAttackedBySlideNJump(
+ [x, y], color, V.PAWN, [[shiftX, 0], [0, 1], [0, -1]], "oneStep");