pub struct Game { /* private fields */ }Expand description
A game tree and its game-level data.
Implementations§
Source§impl Game
impl Game
pub fn play(&self, slot: MoveSlot) -> Result<MoveRef<'_>>
pub fn play_mut(&mut self, slot: MoveSlot) -> Result<MoveMut<'_>>
pub fn position(&self, slot: PositionSlot) -> Result<PositionRef<'_>>
pub fn position_mut(&mut self, slot: PositionSlot) -> Result<PositionMut<'_>>
pub const fn start(&self) -> PositionRef<'_>
pub const fn start_mut(&mut self) -> PositionMut<'_>
pub const fn into_cursor(self) -> Cursor
pub const fn cursor(&self) -> CursorRef<'_>
pub const fn cursor_mut(&mut self) -> CursorMut<'_>
pub const fn order(&self, slot: PositionSlot) -> Order<'_>
Source§impl Game
impl Game
pub fn new(position: Position) -> Self
pub fn with_mode(position: Position, mode: Mode) -> Option<Self>
pub fn chess(position: Position) -> Option<Self>
pub fn freestyle(position: Position) -> Self
Sourcepub fn reslot(&mut self, layout: Layout) -> Reslot
pub fn reslot(&mut self, layout: Layout) -> Reslot
Reassigns move slots in a prescribed layout and returns the old-to-new mapping.
Tracked changes are discarded, as they use the the old slots. Change tracking remains enabled or disabled as configured.
pub const fn mode(&self) -> Mode
pub const fn tracks_changes(&self) -> bool
pub fn track_changes(&mut self, on: bool)
pub fn changes(&self) -> Option<&[Change]>
pub fn revisions(&self) -> Option<usize>
pub fn clear_evaluations(&mut self)
pub const fn public(&self) -> &GamePublic
pub const fn title(&self) -> Option<&Text>
pub const fn orientation(&self) -> Player
pub const fn outcome(&self) -> Outcome
pub const fn roster(&self) -> &Roster
pub fn set_orientation(&mut self, orientation: Player)
pub fn set_title(&mut self, title: Option<Text>)
pub fn set_outcome(&mut self, outcome: Outcome)
pub fn update_roster(&mut self, update: impl FnOnce(&mut Roster))
pub fn update_public(&mut self, update: impl FnOnce(&mut GamePublic))
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Game
impl<'a> Arbitrary<'a> for Game
Source§fn arbitrary(input: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(input: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreimpl 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 UnsafeUnpin 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