Trait Minsweeper
Source pub trait Minsweeper {
// Required methods
fn start(&mut self) -> &GameState;
fn gamestate(&self) -> &GameState;
fn reveal(&mut self, point: Point) -> Result<&GameState, &GameState>;
fn clear_around(&mut self, point: Point) -> Result<&GameState, &GameState>;
fn set_flagged(
&mut self,
point: Point,
flagged: bool,
) -> Result<&GameState, &GameState>;
// Provided methods
fn toggle_flag(&mut self, point: Point) -> Result<&GameState, &GameState> { ... }
fn left_click(&mut self, point: Point) -> Result<&GameState, &GameState> { ... }
fn right_click(&mut self, point: Point) -> Result<&GameState, &GameState> { ... }
}