feat: highlight legal moves on chess board interaction
This commit is contained in:
@@ -212,6 +212,16 @@ class GameEngine(
|
||||
notifyObservers(InvalidMoveEvent(currentBoard, currentHistory, currentTurn, "Error completing promotion."))
|
||||
}
|
||||
|
||||
/** Load an arbitrary board position, clearing all history and undo/redo state. */
|
||||
def loadPosition(board: Board, history: GameHistory, turn: Color): Unit = synchronized {
|
||||
currentBoard = board
|
||||
currentHistory = history
|
||||
currentTurn = turn
|
||||
pendingPromotion = None
|
||||
invoker.clear()
|
||||
notifyObservers(BoardResetEvent(currentBoard, currentHistory, currentTurn))
|
||||
}
|
||||
|
||||
/** Reset the board to initial position. */
|
||||
def reset(): Unit = synchronized {
|
||||
currentBoard = Board.initial
|
||||
|
||||
Reference in New Issue
Block a user