pub struct Game {
pub base_position: Position,
pub moves: MoveHistory,
pub position: Position,
}
Expand description
Game contains information for an in progress game: The base position the game started from, the sequence of moves that were played, and the current position.
Fields§
§base_position: Position
§moves: MoveHistory
§position: Position
Implementations§
Source§impl Game
impl Game
Sourcepub fn new(base_position: Position, moves: MoveHistory) -> Result<Self>
pub fn new(base_position: Position, moves: MoveHistory) -> Result<Self>
Create a new Game from a base position and a sequence of moves. This generates the current position by applying the sequence of moves to the base. If a move in the move history was illegal, Err is returned.
Sourcepub fn start_position() -> Self
pub fn start_position() -> Self
Create a new game in the standard chess start position.
Trait Implementations§
impl Eq for Game
impl StructuralPartialEq for Game
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnwindSafe for Game
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more