[][src]Struct goban::pieces::goban::Goban

pub struct Goban { /* fields omitted */ }

Methods

impl Goban
[src]

pub fn new(size: usize) -> Goban
[src]

pub fn clear(&mut self)
[src]

Removes all the stones from the goban.

pub fn push(
    &mut self,
    coord: &Coord,
    color: Color
) -> Result<&mut Goban, String>
[src]

pub fn push_stone(&mut self, stone: &Stone) -> Result<&mut Goban, String>
[src]

pub fn get(&self, coord: &Coord) -> Color
[src]

pub fn push_many<'a>(
    &'a mut self,
    coords: impl Iterator<Item = &'a Coord>,
    value: Color
)
[src]

Put many stones.

pub fn pop(&mut self) -> &mut Self
[src]

Removes the last

pub fn get_neighbors(
    &self,
    coord: &Coord
) -> impl Iterator<Item = Stone> + '_
[src]

Get all the neighbors to the coordinate

pub fn get_neighbors_stones(
    &self,
    coord: &Coord
) -> impl Iterator<Item = Stone> + '_
[src]

Get all the stones that are neighbor to the coord except empty intersections

pub fn get_stones(
    &self
) -> impl Iterator<Item = Stone> + '_
[src]

Get all the stones except "Empty stones"

pub fn get_stones_by_color(
    &self,
    color: Color
) -> impl Iterator<Item = Stone> + '_
[src]

Get stones by their color.

pub fn get_liberties(
    &self,
    point: &Stone
) -> impl Iterator<Item = Stone> + '_
[src]

Returns the empty stones connected to the point

pub fn get_nb_liberties(&self, point: &Stone) -> u8
[src]

Returns the number of liberties. of the stone

pub fn has_liberties(&self, point: &Stone) -> bool
[src]

Returns true if the stone has liberties.

pub fn pretty_string(&self) -> String
[src]

impl Goban
[src]

pub fn get_dead_stones(&self) -> Vec<HashSet<Stone>>
[src]

Get all the groups of connected atari stones

pub fn get_dead_stones_color(&self, color: Color) -> Vec<HashSet<Stone>>
[src]

Get all the groups of connected atari stones of a color. if the color is empty it's an undefined behaviour

pub fn bfs(&self, point: &Stone) -> HashSet<Stone>
[src]

Can get a group of stones and his neighbors with a Breadth First Search, works for Empty stones too.

pub fn get_strongly_connected_stones(
    &self,
    stones: impl Iterator<Item = Stone>
) -> Vec<HashSet<Stone>>
[src]

Use a breadth first search to deduce the groups of connected stones. Get stones connected. [[x,y,z],[a,e,r]] example of return.

Trait Implementations

impl Eq for Goban
[src]

impl PartialEq<Goban> for Goban
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for Goban
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Goban
[src]

Auto Trait Implementations

impl Send for Goban

impl Sync for Goban

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]