feat: add PromotionRequiredEvent to Observer for pawn promotion notification
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user