diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/command.rs | 4 | ||||
-rw-r--r-- | src/engine/geometry.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/command.rs b/src/engine/command.rs index b34553f..76cfaee 100644 --- a/src/engine/command.rs +++ b/src/engine/command.rs @@ -20,7 +20,7 @@ impl fmt::Display for Command { } impl Command { - pub fn cant_build_yet(&self, energy: u16) -> bool { + pub fn cant_build_yet(self, energy: u16) -> bool { use self::Command::*; match self { @@ -52,7 +52,7 @@ impl BuildingType { if id <= 4 && id != 3 { Some(unsafe { mem::transmute(id) }) } else { None } } - pub fn cant_build_yet(&self, energy: u16) -> bool { + pub fn cant_build_yet(self, energy: u16) -> bool { use self::BuildingType::*; let required = match self { diff --git a/src/engine/geometry.rs b/src/engine/geometry.rs index b9b556a..b8b38dd 100644 --- a/src/engine/geometry.rs +++ b/src/engine/geometry.rs @@ -32,11 +32,11 @@ impl Point { } } - pub fn x(&self) -> u8 { + pub fn x(self) -> u8 { self.index % SINGLE_MAP_WIDTH } - pub fn y(&self) -> u8 { + pub fn y(self) -> u8 { self.index / SINGLE_MAP_WIDTH } } @@ -51,7 +51,7 @@ impl Point { * This involves mirroring the x dimension for the opponent's side */ - pub fn to_either_bitfield(&self) -> u64 { + pub fn to_either_bitfield(self) -> u64 { 1u64 << self.index } } |