diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/map.rs | 8 | ||||
-rw-r--r-- | src/game/player.rs | 2 | ||||
-rw-r--r-- | src/game/powerup.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/game/map.rs b/src/game/map.rs index 567e143..84ec99a 100644 --- a/src/game/map.rs +++ b/src/game/map.rs @@ -7,7 +7,7 @@ pub struct Map { } impl Map { - fn internal_index(p: Point2d<i8>) -> Option<(usize, usize)> { + fn internal_index(p: Point2d) -> Option<(usize, usize)> { if p.y < 0 || p.y as usize >= MAP_SIZE { None } else { @@ -23,14 +23,14 @@ impl Map { } } - pub fn at(&self, p: Point2d<i8>) -> Option<bool> { + pub fn at(&self, p: Point2d) -> Option<bool> { Map::internal_index(p).map(|(integer, bit)| { let mask = 1 << bit; self.cells[integer] & mask != 0 }) } - pub fn set(&mut self, p: Point2d<i8>) { + pub fn set(&mut self, p: Point2d) { if let Some((integer, bit)) = Map::internal_index(p) { let mask = 1 << bit; self.cells[integer] |= mask; @@ -38,7 +38,7 @@ impl Map { panic!("Tried to set an out of bounds bit, {:?}", p); } } - pub fn clear(&mut self, p: Point2d<i8>) { + pub fn clear(&mut self, p: Point2d) { if let Some((integer, bit)) = Map::internal_index(p) { let mask = !(1 << bit); self.cells[integer] &= mask; diff --git a/src/game/player.rs b/src/game/player.rs index 3d86c6d..0874c76 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -13,7 +13,7 @@ pub struct Player { pub struct Worm { pub id: i32, pub health: i32, - pub position: Point2d<i8>, + pub position: Point2d, pub bombs: u8, pub snowballs: u8, pub rounds_until_unfrozen: u8, diff --git a/src/game/powerup.rs b/src/game/powerup.rs index f8a8e2f..47e73a1 100644 --- a/src/game/powerup.rs +++ b/src/game/powerup.rs @@ -2,5 +2,5 @@ use crate::geometry::*; #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub struct Powerup { - pub position: Point2d<i8>, + pub position: Point2d, } |