From 95e4643300ade39c457267636e86fbddcbfd21c8 Mon Sep 17 00:00:00 2001 From: Aryan Naraghi Date: Sun, 13 Oct 2024 14:58:23 -0700 Subject: [PATCH] Renames a helper function. --- engine/src/moves.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/moves.ts b/engine/src/moves.ts index c704323..dee8aab 100644 --- a/engine/src/moves.ts +++ b/engine/src/moves.ts @@ -103,7 +103,7 @@ export class MoveGenerator { } } - private generatePawnMovesHelper( + private moveOrPromotePawn( from: TSquare, to: TSquare, piece: "P" | "p" @@ -144,7 +144,7 @@ export class MoveGenerator { const frontSquare = SQUARES[this.toIndex(frontFile, frontRank)]; const destinationPiece = this.board.get(frontSquare); if (!destinationPiece) { - moves.push(...this.generatePawnMovesHelper(from, frontSquare, piece)); + moves.push(...this.moveOrPromotePawn(from, frontSquare, piece)); if (isFirstMove) { const secondFile = frontFile + front.file; @@ -166,7 +166,7 @@ export class MoveGenerator { const to = SQUARES[this.toIndex(newFile, newRank)]; const destinationPiece = this.board.get(to); if (destinationPiece && getSide(piece) !== getSide(destinationPiece)) { - moves.push(...this.generatePawnMovesHelper(from, to, piece)); + moves.push(...this.moveOrPromotePawn(from, to, piece)); } } }