Skip to content

Commit

Permalink
Implement JsContainerFromValue for StructureSpawn
Browse files Browse the repository at this point in the history
(needed for the changes in the starter I pushed a couple days ago for the starter but didn't commit)
  • Loading branch information
shanemadden committed Jun 29, 2021
1 parent d0ca5ba commit 2a12d3d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/objects/impls/structure_spawn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{Part, constants::ReturnCode, objects::{Creep, OwnedStructure, RoomObject, Store, Structure}, prelude::*};
use crate::{Part, constants::ReturnCode, objects::{Creep, OwnedStructure, RoomObject, Store, Structure}, prelude::*, containers::JsContainerFromValue};
use js_sys::{Array, JsString, Object};
use wasm_bindgen::prelude::*;
use wasm_bindgen::{JsCast, prelude::*};

#[wasm_bindgen]
extern "C" {
Expand Down Expand Up @@ -84,6 +84,12 @@ impl StructureSpawn {
}
}

impl JsContainerFromValue for StructureSpawn {
fn from_value(val: JsValue) -> Self {
val.unchecked_into()
}
}

impl HasStore for StructureSpawn {
fn store(&self) -> Store {
Self::store(self)
Expand Down

0 comments on commit 2a12d3d

Please sign in to comment.