feat: add PromotionRequiredEvent to Observer for pawn promotion notification

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 14:00:51 +02:00
parent 2a5755a905
commit e6d43be260
@@ -1,6 +1,6 @@
package de.nowchess.chess.observer
import de.nowchess.api.board.{Board, Color}
import de.nowchess.api.board.{Board, Color, Square}
import de.nowchess.chess.logic.GameHistory
/** Base trait for all game state events.
@@ -51,6 +51,15 @@ case class InvalidMoveEvent(
reason: String
) extends GameEvent
/** Fired when a pawn reaches the back rank and the player must choose a promotion piece. */
case class PromotionRequiredEvent(
board: Board,
history: GameHistory,
turn: Color,
from: Square,
to: Square
) extends GameEvent
/** Fired when the board is reset. */
case class BoardResetEvent(
board: Board,