mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'lemu/src/memory.rs')
| -rw-r--r-- | lemu/src/memory.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lemu/src/memory.rs b/lemu/src/memory.rs index ddb0e8a..86024c3 100644 --- a/lemu/src/memory.rs +++ b/lemu/src/memory.rs @@ -28,6 +28,13 @@ impl LVar<'_> { pub const fn null() -> LVar<'static> { LVar::Num(0.0) } + + pub fn num(&self) -> Option<f64> { + match *self { + Self::Num(n) => Some(n), + Self::String(_) => None, + } + } } #[derive(Clone, Copy)] |