diff --git a/src/enums.rs b/src/enums.rs index 260c64d9..54b55338 100644 --- a/src/enums.rs +++ b/src/enums.rs @@ -3,6 +3,7 @@ use wasm_bindgen::{JsCast, JsValue}; use crate::objects::*; use crate::prelude::*; +use crate::JsContainerFromValue; #[enum_dispatch(Attackable)] pub enum AttackableObject { @@ -398,6 +399,12 @@ impl From for StructureObject { } } +impl JsContainerFromValue for StructureObject { + fn from_value(val: JsValue) -> Self { + Self::from(val) + } +} + impl From for StructureObject { fn from(structure: Structure) -> Self { use crate::constants::StructureType::*; @@ -611,4 +618,4 @@ impl StructureObject { Self::StructureInvaderCore(_) => None, } } -} \ No newline at end of file +}