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>>>
Implementations§
Source§impl<'a> Board<'a>
impl<'a> Board<'a>
pub fn new(size: usize) -> Board<'a>
pub fn seat(&mut self, player: &'a Player)
pub fn play<Q>( &mut self, position: Q, player: &'a Player, ) -> Result<(), PiecePlacementErr>
pub fn get(&self, x: usize, y: usize) -> Option<&Stone<'a>>
pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut Stone<'a>>
pub fn get_direct_opt(&self, x: usize, y: usize) -> Option<&Option<Stone<'a>>>
pub fn get_mut_direct_opt( &mut self, x: usize, y: usize, ) -> Option<&mut Option<Stone<'a>>>
pub fn get_row(&self, row: usize) -> Vec<&Option<Stone<'a>>>
pub fn get_column(&self, column: usize) -> Vec<&Option<Stone<'a>>>
pub fn get_harmonies(&self) -> Vec<Harmony<'_>>
pub fn get_move_dir_for_stone(&self, x: usize, y: usize) -> MoveDir
pub fn move_stone<S, D>( &mut self, source: S, destination: D, ) -> Result<(), MoveErr>
pub fn update_life(&mut self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Board<'a>
impl<'a> RefUnwindSafe for Board<'a>
impl<'a> Send for Board<'a>
impl<'a> Sync for Board<'a>
impl<'a> Unpin for Board<'a>
impl<'a> UnwindSafe for Board<'a>
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