[−][src]Struct goban::rules::game::Game
Methods
impl Game
[src]
impl Game
pub fn goban(&self) -> &Goban | [src] |
pub fn prisoners(&self) -> &(u32, u32) | [src] |
pub fn turn(&self) -> &bool | [src] |
pub fn komi(&self) -> &f32 | [src] |
pub fn plays(&self) -> &Vec<Goban> | [src] |
impl Game
[src]
impl Game
pub fn set_goban(&mut self, val: Goban) -> &mut Self | [src] |
pub fn set_prisoners(&mut self, val: (u32, u32)) -> &mut Self | [src] |
pub fn set_turn(&mut self, val: bool) -> &mut Self | [src] |
pub fn set_komi(&mut self, val: f32) -> &mut Self | [src] |
pub fn set_plays(&mut self, val: Vec<Goban>) -> &mut Self | [src] |
impl Game
[src]
impl Game
pub fn new(size: GobanSizes) -> Game | [src] |
impl Game
[src]
impl Game
pub fn resume(&mut self) | [src] |
Resume the game when to players have passed, and want to continue.
pub fn over<T: Rule>(&self) -> bool | [src] |
True when the game is over (two passes, or no more legals moves, Resign)
pub fn end_game<T: Rule>(&self) -> Option<EndGame> | [src] |
Returns the endgame. None if the game is not finished
pub fn pop(&mut self) | [src] |
Removes the last move.
pub fn legals<T: Rule>( | [src] |
Returns a list with legals moves, In the list will appear suicides moves, and ko moves.
pub fn display(&self) | [src] |
Prints the goban.
pub fn play(&mut self, play: &Move) | [src] |
Method to play on the goban or pass.
pub fn play_with_verifications<R: Rule>( | [src] |
Method to play but it verifies if the play is legal or not.
pub fn calculate_territories(&self) -> (f32, f32) | [src] |
Calculates a score for the endgame. It's a naive implementation, it counts only territories with the same color surrounding them.
Returns (black territory, white territory)
pub fn is_suicide(&self, stone: &Stone) -> bool | [src] |
Add a stone to the board an then test if the stone or stone group is dead. Returns true if the move is a suicide
pub fn is_ko(&self, stone: &Stone) -> bool | [src] |
If the goban is in the configuration of the two plays ago returns true
pub fn super_ko(&self, stone: &Stone) -> bool | [src] |
Rule of the super Ko, if any before configuration was already played then the move is illegal
pub fn are_dead(&self, stones: &HashSet<Stone>) -> bool | [src] |
Test if a group of stones is dead.
"a group of stones is dead if it doesn't have liberties"
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |