Renamed variable to be more concise
[entelect-challenge-tower-defence.git] / src / engine / bitwise_engine.rs
index f03f1c0..694a309 100644 (file)
@@ -224,7 +224,7 @@ impl BitwiseGameState {
                 player.energy -= TESLA_FIRING_ENERGY;
                 tesla.cooldown = TESLA_COOLDOWN;
 
-                if tesla.pos.to_either_bitfield() & RIGHT_COL_MASK != 0 {
+                if tesla.pos.to_bitfield() & RIGHT_COL_MASK != 0 {
                     opponent.health = opponent.health.saturating_sub(TESLA_DAMAGE);
                 }
 
@@ -291,7 +291,7 @@ impl BitwiseGameState {
 
     fn update_tesla_activity(buildings: &mut Player) {
         let occupied = buildings.occupied;
-        buildings.tesla_cooldowns.retain(|t| (t.pos.to_either_bitfield() & occupied) != 0);
+        buildings.tesla_cooldowns.retain(|t| (t.pos.to_bitfield() & occupied) != 0);
     }
     
     
@@ -356,7 +356,7 @@ impl Player {
     pub fn location_of_unoccupied_cell(&self, i: usize) -> Point  {
         let bit = find_bit_index_from_rank(self.occupied, i as u64);
         let point = Point { index: bit };
-        debug_assert!(point.to_either_bitfield() & self.occupied == 0);
+        debug_assert!(point.to_bitfield() & self.occupied == 0);
         point
     }
 
@@ -365,7 +365,7 @@ impl Player {
         match command {
             Command::Nothing => {},
             Command::Build(p, b) => {
-                let bitfield = p.to_either_bitfield();
+                let bitfield = p.to_bitfield();
 
                 let price = match b {
                     BuildingType::Attack => MISSILE_PRICE,
@@ -415,7 +415,7 @@ impl Player {
                 let health = if building_type == BuildingType::Defence { DEFENCE_HEALTH } else { 1 };
 
                 let pos = self.unconstructed[i].pos;
-                let bitfield = pos.to_either_bitfield();
+                let bitfield = pos.to_bitfield();
 
                 for health_tier in 0..health {
                     self.buildings[health_tier] |= bitfield;