pub struct Game { /* private fields */ }
Implementations§
Source§impl Game
impl Game
pub fn new(size: usize) -> Game
pub fn turn_number(&self) -> usize
pub fn predict(&self, ai: Ai) -> Turn
pub fn size(&self) -> usize
pub fn to_string(&self) -> String
pub fn play_simple(&mut self, turn: &str) -> Result<Option<Player>, String>
pub fn player_move( &mut self, turn: &str, player: Player, ) -> Result<Option<Player>, String>
pub fn play( &mut self, turn: &str, player: Player, owner: Option<Player>, ) -> Result<Option<Player>, String>
pub fn play_parsed( &mut self, turn: Turn, owner: Option<Player>, ) -> Result<Option<Player>, String>
pub fn as_ptn(&self) -> String
Sourcepub fn check_flat_winner(&self) -> Option<Player>
pub fn check_flat_winner(&self) -> Option<Player>
Checks for the winner via a flat win
Counts the number of pieces laid, and if either player is out of pieces, then tallies the points to determine the winner
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)