[board] Implement position::builders::MoveBuilder
This builder takes a Position and a Move, validates the move, and makes the move in that position. Its build() method returns a new Position with the move made.
This commit is contained in:
parent
7b8ce3b31d
commit
21b5266789
7 changed files with 323 additions and 4 deletions
|
@ -10,6 +10,14 @@ use std::fmt;
|
|||
|
||||
pub(crate) use move_formatter::AlgebraicMoveFormatter;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum MakeMoveError {
|
||||
PlayerOutOfTurn,
|
||||
NoPiece,
|
||||
NoCapturedPiece,
|
||||
IllegalCastle,
|
||||
}
|
||||
|
||||
#[repr(u16)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Castle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue