Skip to content

Enhance Board.js movePiece for Game Logic #15

@jane-alesi

Description

@jane-alesi

Enhance the existing movePiece method in src/core/Board.js to handle piece properties and return relevant move information.

Acceptance Criteria:

  • The movePiece(fromIndex, toIndex) method in Board.js is updated.
  • It correctly updates the hasMoved property of the moved piece (especially for King, Rook, and Pawn).
  • It returns an object containing details about the move, such as from, to, pieceMoved, pieceCaptured (if any), and success status.
  • It should still prevent moves from empty squares or invalid indices.
  • This method should be called by the Game class after input handling.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions