[board, position] Return replaced piece when placing a piece with PlacePieceStrategy::Replace
When place_piece() is called with PlacePieceStrategy::Replace, return the replaced piece in the Ok() variant of the Result as an Option<Piece>. Plumb this new return type through Board and Position.
This commit is contained in:
parent
09fbe1be22
commit
cae93cb090
3 changed files with 7 additions and 5 deletions
|
@ -59,7 +59,7 @@ impl Position {
|
|||
piece: Piece,
|
||||
square: Square,
|
||||
strategy: PlacePieceStrategy,
|
||||
) -> Result<(), PlacePieceError> {
|
||||
) -> Result<Option<Piece>, PlacePieceError> {
|
||||
self.board.place_piece(piece, square, strategy)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue