diff options
Diffstat (limited to 'src/character.rs')
-rw-r--r-- | src/character.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/character.rs b/src/character.rs index 2f2289f..4c7f7dc 100644 --- a/src/character.rs +++ b/src/character.rs @@ -4,9 +4,9 @@ use character::rand::Rng; use location::Location; pub struct Character{ - pub symbol : char, - pub color : u8, - pub location : Location, + pub symbol : char, + pub color : u8, + pub location : Location, } impl Copy for Character {} @@ -19,18 +19,18 @@ impl Clone for Character { impl Character { pub fn new(symbol : char, color : u8, location : Location) -> Character { Character { - symbol : symbol, - color : color, - location : location, + symbol : symbol, + color : color, + location : location, } } - pub fn action(&mut self, free_spaces : Vec<Location>){ + pub fn action(&mut self, free_spaces : Vec<Location>) { self.wander(free_spaces); } - fn wander(&mut self, free_spaces : Vec<Location>){ - let direction = rand::thread_rng().gen_range(0,free_spaces.len()); + fn wander(&mut self, free_spaces : Vec<Location>) { + let direction = rand::thread_rng().gen_range(0, free_spaces.len()); self.location = free_spaces[direction]; } } |