Struct taxi::Game
[−]
[src]
pub struct Game { /* fields omitted */ }
The Game with accompanying state
Methods
impl Game
[src]
fn new(print: bool) -> Game
Initialize a new game state
fn world_size(&self) -> (usize, usize)
Returns size of the game world
fn has_won(&self) -> bool
Returns true if player has won the game
fn passenger_position(&self) -> (u32, u32)
Passenger position
fn goal_position(&self) -> (u32, u32)
Goal position
fn player_position(&self) -> (u32, u32)
Returns player position
fn passenger_picked_up(&self) -> bool
Returns true if passenger has been picked up
fn distance_to_goal(&self) -> f64
Returns a distance to a game goal
fn distance_to_passenger(&self) -> f64
Returns a distance to a passenger
fn enter_move(&mut self, dir: Dir, print: bool) -> bool
Enter move directly and optionally print the map Returns a bool signifying whether or not this move lead to winning the game
fn make_move(&mut self, dir: Dir)
Makes a move and mutates the board, doesn't return anything
fn print_map(&self)
Print the map on screen
Trait Implementations
impl PartialEq for Game
[src]
fn eq(&self, __arg_0: &Game) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Game) -> bool
This method tests for !=
.
impl Eq for Game
[src]
impl Hash for Game
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for Game
[src]
fn clone(&self) -> Game
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