mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/units.rs')
| -rw-r--r-- | src/block/units.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/block/units.rs b/src/block/units.rs index 9a893d8..c34f944 100644 --- a/src/block/units.rs +++ b/src/block/units.rs @@ -178,9 +178,7 @@ impl BlockLogic for ConstructorBlock { } } - fn clone_state(&self, state: &State) -> State { - Box::new(*Self::get_state(state)) - } + fn serialize_state(&self, state: &State) -> Result<DynData, SerializeError> { Ok(Self::get_state(state).map_or(DynData::Empty, DynData::UnitCommand)) @@ -322,10 +320,7 @@ impl BlockLogic for UnitFactory { } } - fn clone_state(&self, state: &State) -> State { - let state = Self::get_state(state); - Box::new(Self::create_state(*state)) - } + fn serialize_state(&self, state: &State) -> Result<DynData, SerializeError> { if let Some(state) = Self::get_state(state) { |