summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-08-27 22:40:02 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-08-27 22:40:02 +0200
commit72a29f9844a86050c5632861f71855713878c0b5 (patch)
tree614cafe5c36aa873972a58d68487ad85887c17e0 /src
parent5c299a662f178832d6d0722dabdec5cf4dd73e02 (diff)
Removed unused deconstruct command
Diffstat (limited to 'src')
-rw-r--r--src/engine/bitwise_engine.rs22
-rw-r--r--src/engine/command.rs2
2 files changed, 0 insertions, 24 deletions
diff --git a/src/engine/bitwise_engine.rs b/src/engine/bitwise_engine.rs
index 0429e84..102f3fb 100644
--- a/src/engine/bitwise_engine.rs
+++ b/src/engine/bitwise_engine.rs
@@ -376,28 +376,6 @@ impl Player {
});
self.occupied |= bitfield;
},
- Command::Deconstruct(p) => {
- let unconstructed_to_remove_index = self.unconstructed.iter().position(|ref b| b.pos == p);
- let deconstruct_mask = !(p.to_either_bitfield() & self.buildings[0]);
-
- debug_assert!(deconstruct_mask != 0 || unconstructed_to_remove_index.is_some());
-
- if let Some(i) = unconstructed_to_remove_index {
- self.unconstructed.swap_remove(i);
- }
-
- self.energy += DECONSTRUCT_ENERGY;
-
- for tier in 0..self.buildings.len() {
- self.buildings[tier] &= deconstruct_mask;
- }
- self.energy_towers &= deconstruct_mask;
- for tier in 0..self.missile_towers.len() {
- self.missile_towers[tier] &= deconstruct_mask;
- }
- self.tesla_cooldowns.retain(|t| t.pos != p);
- self.occupied &= deconstruct_mask;
- },
Command::IronCurtain => {
debug_assert!(self.iron_curtain_available);
debug_assert!(self.energy >= IRON_CURTAIN_PRICE);
diff --git a/src/engine/command.rs b/src/engine/command.rs
index c4268c5..d026bca 100644
--- a/src/engine/command.rs
+++ b/src/engine/command.rs
@@ -5,7 +5,6 @@ use super::geometry::Point;
pub enum Command {
Nothing,
Build(Point, BuildingType),
- Deconstruct(Point),
IronCurtain
}
@@ -14,7 +13,6 @@ impl fmt::Display for Command {
match *self {
Command::Nothing => write!(f, ""),
Command::Build(p, b) => write!(f, "{},{},{}", p.x(), p.y(), b as u8),
- Command::Deconstruct(p) => write!(f, "{},{},3", p.x(), p.y()),
Command::IronCurtain => write!(f, "0,0,5")
}
}