Struct harmony::Board [] [src]

pub struct Board<'a> {
    pub players: Vec<&'a Player>,
    pub size: usize,
    pub board: Vec<Option<Stone<'a>>>,
}

Fields

players: Vec<&'a Player> size: usize board: Vec<Option<Stone<'a>>>

Methods

impl<'a> Board<'a>
[src]

fn new(size: usize) -> Board<'a>

fn seat(&mut self, player: &'a Player)

fn play<Q>(&mut self, position: Q, player: &'a Player) -> Result<()PiecePlacementErr> where Q: Into<Coord>

fn get(&self, x: usize, y: usize) -> Option<&Stone<'a>>

fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut Stone<'a>>

fn get_direct_opt(&self, x: usize, y: usize) -> Option<&Option<Stone<'a>>>

fn get_mut_direct_opt(&mut self, x: usize, y: usize) -> Option<&mut Option<Stone<'a>>>

fn get_row(&self, row: usize) -> Vec<&Option<Stone<'a>>>

fn get_column(&self, column: usize) -> Vec<&Option<Stone<'a>>>

fn get_harmonies(&self) -> Vec<Harmony>

fn get_move_dir_for_stone(&self, x: usize, y: usize) -> MoveDir

fn move_stone<S, D>(&mut self, source: S, destination: D) -> Result<()MoveErr> where S: Into<Coord>, D: Into<Coord>

fn update_life(&mut self) -> usize

Trait Implementations

impl<'a> Clone for Board<'a>
[src]

fn clone(&self) -> Board<'a>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<'a> Debug for Board<'a>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.