Enum screeps::constants::structure::StructureType   
source · pub enum StructureType {
Show 21 variants
    Spawn = 0,
    Extension = 1,
    Road = 2,
    Wall = 3,
    Rampart = 4,
    KeeperLair = 5,
    Portal = 6,
    Controller = 7,
    Link = 8,
    Storage = 9,
    Tower = 10,
    Observer = 11,
    PowerBank = 12,
    PowerSpawn = 13,
    Extractor = 14,
    Lab = 15,
    Terminal = 16,
    Container = 17,
    Nuker = 18,
    Factory = 19,
    InvaderCore = 20,
    // some variants omitted
}Expand description
Translates STRUCTURE_* constants.
Variants§
Spawn = 0
Extension = 1
Road = 2
Wall = 3
Rampart = 4
KeeperLair = 5
Portal = 6
Controller = 7
Link = 8
Storage = 9
Tower = 10
Observer = 11
PowerBank = 12
PowerSpawn = 13
Extractor = 14
Lab = 15
Terminal = 16
Container = 17
Nuker = 18
Factory = 19
InvaderCore = 20
Implementations§
source§impl StructureType
 
impl StructureType
pub fn from_js_value(obj: &JsValue) -> Option<StructureType>
source§impl StructureType
 
impl StructureType
sourcepub const fn construction_cost(self) -> Option<u32>
 
pub const fn construction_cost(self) -> Option<u32>
Translates the CONSTRUCTION_COST constant.
sourcepub const fn controller_structures(self, current_rcl: u32) -> u32
 
pub const fn controller_structures(self, current_rcl: u32) -> u32
Translates the CONTROLLER_STRUCTURES constant
sourcepub const fn initial_hits(self) -> Option<u32>
 
pub const fn initial_hits(self) -> Option<u32>
Translates the *_HITS constants, initial hits for structures
Trait Implementations§
source§impl Clone for StructureType
 
impl Clone for StructureType
source§fn clone(&self) -> StructureType
 
fn clone(&self) -> StructureType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for StructureType
 
impl Debug for StructureType
source§impl<'de> Deserialize<'de> for StructureType
 
impl<'de> Deserialize<'de> for StructureType
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
    D: Deserializer<'de>,
 
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for StructureType
 
impl Display for StructureType
source§impl From<StructureType> for JsValue
 
impl From<StructureType> for JsValue
source§fn from(obj: StructureType) -> JsValue
 
fn from(obj: StructureType) -> JsValue
Converts to this type from the input type.
source§impl FromStr for StructureType
 
impl FromStr for StructureType
source§impl FromWasmAbi for StructureType
 
impl FromWasmAbi for StructureType
source§impl Hash for StructureType
 
impl Hash for StructureType
source§impl IntoWasmAbi for StructureType
 
impl IntoWasmAbi for StructureType
source§impl OptionFromWasmAbi for StructureType
 
impl OptionFromWasmAbi for StructureType
source§impl OptionIntoWasmAbi for StructureType
 
impl OptionIntoWasmAbi for StructureType
source§impl PartialEq for StructureType
 
impl PartialEq for StructureType
source§fn eq(&self, other: &StructureType) -> bool
 
fn eq(&self, other: &StructureType) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.source§impl Sequence for StructureType
 
impl Sequence for StructureType
source§impl Serialize for StructureType
 
impl Serialize for StructureType
impl Copy for StructureType
impl Eq for StructureType
impl StructuralEq for StructureType
impl StructuralPartialEq for StructureType
Auto Trait Implementations§
impl RefUnwindSafe for StructureType
impl Send for StructureType
impl Sync for StructureType
impl Unpin for StructureType
impl UnwindSafe for StructureType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> ReturnWasmAbi for Twhere
    T: IntoWasmAbi,
 
impl<T> ReturnWasmAbi for Twhere T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
 
type Abi = <T as IntoWasmAbi>::Abi
Same as 
IntoWasmAbi::Abisource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
 
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as 
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.