screeps-game-api 0.23.3

WASM bindings to the in-game Screeps API
Documentation
use wasm_bindgen::prelude::*;

use crate::{
    objects::{OwnedStructure, RoomObject, Store, Structure},
    prelude::*,
};

#[wasm_bindgen]
extern "C" {
    /// An object representing a [`StructureStorage`], which can store large
    /// amounts of resources.
    ///
    /// [Screeps documentation](https://docs.screeps.com/api/#StructureStorage)
    #[wasm_bindgen(extends = RoomObject, extends = Structure, extends = OwnedStructure)]
    #[derive(Clone, Debug)]
    pub type StructureStorage;

    /// The [`Store`] of the storage, which contains information about what
    /// resources it is it holding.
    ///
    /// [Screeps documentation](https://docs.screeps.com/api/#StructureStorage.store)
    #[wasm_bindgen(method, getter)]
    pub fn store(this: &StructureStorage) -> Store;
}

impl HasStore for StructureStorage {
    fn store(&self) -> Store {
        Self::store(self)
    }
}

impl Attackable for StructureStorage {}
impl Dismantleable for StructureStorage {}
impl Repairable for StructureStorage {}
impl Transferable for StructureStorage {}
impl Withdrawable for StructureStorage {}