pub struct GameState {
pub player: (usize, usize),
pub width: usize,
pub height: usize,
/* private fields */
}
Fields
player: (usize, usize)
width: usize
height: usize
Implementations
sourceimpl GameState
impl GameState
pub fn new(width: usize, height: usize, nof_mines: usize) -> GameState
pub fn flag(&mut self) -> Result<(), RangeError>
pub fn has_mine(&self, x: usize, y: usize) -> bool
pub fn move_player_right(&mut self)
pub fn move_player_left(&mut self)
pub fn move_player_up(&mut self)
pub fn move_player_down(&mut self)
pub fn resurect(&mut self)
pub fn reveal(&mut self) -> Result<(), RangeError>
pub fn mines_left(&self) -> usize
pub fn check_has_won(&mut self) -> bool
pub fn is_player(&self, x: usize, y: usize) -> bool
pub fn is_opened(&self, x: usize, y: usize) -> bool
pub fn is_flagged(&self, x: usize, y: usize) -> bool
pub fn count_mines_around(&self, x: usize, y: usize) -> u8
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GameState
impl Send for GameState
impl Sync for GameState
impl Unpin for GameState
impl UnwindSafe for GameState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more