mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/mod.rs')
| -rw-r--r-- | src/block/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/block/mod.rs b/src/block/mod.rs index 5f03b85..5a8ff22 100644 --- a/src/block/mod.rs +++ b/src/block/mod.rs @@ -2,6 +2,8 @@ use std::borrow::Cow; use std::collections::HashMap; use std::collections::hash_map::Entry; +use crate::data::dynamic::DynData; + pub trait BlockLogic { fn get_size(&self) -> u8; @@ -10,6 +12,11 @@ pub trait BlockLogic { true } + + fn state_from_i32(&self, _config: i32) -> DynData + { + DynData::Empty + } } pub struct Block @@ -39,6 +46,11 @@ impl Block { self.logic.is_symmetric() } + + pub fn state_from_i32(&self, config: i32) -> DynData + { + self.logic.state_from_i32(config) + } } #[derive(Clone, Copy, Debug, Eq, PartialEq)] |