screeps/objects/impls/
structure_storage.rs

1use wasm_bindgen::prelude::*;
2
3use crate::{
4    objects::{OwnedStructure, RoomObject, Store, Structure},
5    prelude::*,
6};
7
8#[wasm_bindgen]
9extern "C" {
10    /// An object representing a [`StructureStorage`], which can store large
11    /// amounts of resources.
12    ///
13    /// [Screeps documentation](https://docs.screeps.com/api/#StructureStorage)
14    #[wasm_bindgen(extends = RoomObject, extends = Structure, extends = OwnedStructure)]
15    #[derive(Clone, Debug)]
16    pub type StructureStorage;
17
18    /// The [`Store`] of the storage, which contains information about what
19    /// resources it is it holding.
20    ///
21    /// [Screeps documentation](https://docs.screeps.com/api/#StructureStorage.store)
22    #[wasm_bindgen(method, getter)]
23    pub fn store(this: &StructureStorage) -> Store;
24}
25
26impl HasStore for StructureStorage {
27    fn store(&self) -> Store {
28        Self::store(self)
29    }
30}
31
32impl Attackable for StructureStorage {}
33impl Dismantleable for StructureStorage {}
34impl Repairable for StructureStorage {}
35impl Transferable for StructureStorage {}
36impl Withdrawable for StructureStorage {}