Skip to content

Commit

Permalink
Renames a helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
aryann committed Oct 13, 2024
1 parent b2fe0dc commit 95e4643
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/src/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class MoveGenerator {
}
}

private generatePawnMovesHelper(
private moveOrPromotePawn(
from: TSquare,
to: TSquare,
piece: "P" | "p"
Expand Down Expand Up @@ -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;
Expand All @@ -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));
}
}
}
Expand Down

0 comments on commit 95e4643

Please sign in to comment.