pub unsafe trait HasStore: RoomObjectProperties {
fn store_total(&self) -> u32 { ... }
fn store_types(&self) -> Vec<ResourceType> { ... }
fn store_of(&self, ty: ResourceType) -> u32 { ... }
fn energy(&self) -> u32 { ... }
fn store_capacity(&self, resource: Option<ResourceType>) -> u32 { ... }
fn store_free_capacity(&self, resource: Option<ResourceType>) -> i32 { ... }
fn store_used_capacity(&self, resource: Option<ResourceType>) -> u32 { ... }
}
Expand description
Trait for all wrappers over Screeps JavaScript objects with a
store
property.
Contracts
The JavaScript object referenced by the return of AsRef<Reference>::as_ref
must have a store
property.
The store
property must be a dict from string resource types to integers,
and have the getCapacity
, getFreeCapacity
, and getUsedCapacity
functions
Provided Methods
source
fn store_total(&self) -> u32
source
fn store_types(&self) -> Vec<ResourceType>
source
fn store_of(&self, ty: ResourceType) -> u32
source
fn store_capacity(&self, resource: Option<ResourceType>) -> u32
source
fn store_free_capacity(&self, resource: Option<ResourceType>) -> i32
source
fn store_used_capacity(&self, resource: Option<ResourceType>) -> u32
Implementors
impl HasStore for Creep
impl HasStore for PowerCreep
impl HasStore for Ruin
impl HasStore for ScoreCollector
Available on crate feature
score
only.impl HasStore for ScoreContainer
Available on crate feature
score
only.impl HasStore for StructureContainer
impl HasStore for StructureExtension
impl HasStore for StructureFactory
impl HasStore for StructureLab
impl HasStore for StructureLink
impl HasStore for StructureNuker
impl HasStore for StructurePowerSpawn
impl HasStore for StructureSpawn
impl HasStore for StructureStorage
impl HasStore for StructureTerminal
impl HasStore for StructureTower
impl HasStore for SymbolContainer
Available on crate feature
symbols
only.