#[repr(i16)]
pub enum RoomObject {
Show 28 variants Creeps = 101, MyCreeps = 102, HostileCreeps = 103, SourcesActive = 104, Sources = 105, DroppedResources = 106, Structures = 107, MyStructures = 108, HostileStructures = 109, Flags = 110, ConstructionSites = 111, MySpawns = 112, HostileSpawns = 113, MyConstructionSites = 114, HostileConstructionSites = 115, Minerals = 116, Nukes = 117, Tombstones = 118, PowerCreeps = 119, MyPowerCreeps = 120, HostilePowerCreeps = 121, Deposits = 122, Ruins = 123, ScoreContainers = 10_011, ScoreCollectors = 10_012, SymbolContainers = 10_021, SymbolDecoders = 10_022, Reactors = 10_051,
}
Expand description

Useful for finding any RoomObject with a dynamically-chosen find constant.

If you know ahead of time what constant you’ll use, then the all-upper-case constants in this module will be more helpful, and won’t require casting the result types.

Note: To avoid ambiguity with RoomObject, you should refer to this enum as find::RoomObject rather than importing it directly.

Variants§

§

Creeps = 101

§

MyCreeps = 102

§

HostileCreeps = 103

§

SourcesActive = 104

§

Sources = 105

§

DroppedResources = 106

§

Structures = 107

§

MyStructures = 108

§

HostileStructures = 109

§

Flags = 110

§

ConstructionSites = 111

§

MySpawns = 112

§

HostileSpawns = 113

§

MyConstructionSites = 114

§

HostileConstructionSites = 115

§

Minerals = 116

§

Nukes = 117

§

Tombstones = 118

§

PowerCreeps = 119

§

MyPowerCreeps = 120

§

HostilePowerCreeps = 121

§

Deposits = 122

§

Ruins = 123

§

ScoreContainers = 10_011

Available on crate feature seasonal-season-1 only.
§

ScoreCollectors = 10_012

Available on crate feature seasonal-season-1 only.
§

SymbolContainers = 10_021

Available on crate feature seasonal-season-2 only.
§

SymbolDecoders = 10_022

Available on crate feature seasonal-season-2 only.
§

Reactors = 10_051

Available on crate feature seasonal-season-5 only.

Trait Implementations§

source§

impl Clone for RoomObject

source§

fn clone(&self) -> RoomObject

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RoomObject

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FindConstant for RoomObject

§

type Item = RoomObject

source§

fn convert_and_check_item(reference: JsValue) -> Self::Item

source§

fn find_code(&self) -> Find

source§

impl Hash for RoomObject

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RoomObject

source§

fn eq(&self, other: &RoomObject) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for RoomObject

source§

impl Eq for RoomObject

source§

impl StructuralEq for RoomObject

source§

impl StructuralPartialEq for RoomObject

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.