Skip to content

Commit dff6062

Browse files
committed
Switch LValue::Building to store building instead of position
1 parent c149284 commit dff6062

File tree

5 files changed

+281
-160
lines changed

5 files changed

+281
-160
lines changed

src/logic/vm/buildings.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub const WORLD_SWITCH: &str = "world-switch";
3131
const MESSAGE_MAX_LEN: usize = 220;
3232
const MESSAGE_MAX_LINES: usize = 24;
3333

34+
#[derive(Debug, Clone)]
3435
pub struct Building {
3536
pub block: &'static Block,
3637
pub position: Point2,
@@ -213,7 +214,13 @@ impl Building {
213214
}
214215
}
215216

216-
#[derive(IntoStaticStr)]
217+
impl PartialEq for Building {
218+
fn eq(&self, other: &Self) -> bool {
219+
self.block == other.block && self.position == other.position
220+
}
221+
}
222+
223+
#[derive(Debug, IntoStaticStr)]
217224
pub enum BuildingData {
218225
Processor(Box<Processor>),
219226
Memory(Box<[f64]>),

0 commit comments

Comments
 (0)