Struct screeps::objects::StructureSpawn
source · [−]pub struct StructureSpawn(_);
Implementations
sourceimpl StructureSpawn
impl StructureSpawn
sourceimpl StructureSpawn
impl StructureSpawn
pub fn memory(&self) -> MemoryReference
pub fn spawn_creep(&self, body: &[Part], name: &str) -> ReturnCode
pub fn spawn_creep_with_options(
&self,
body: &[Part],
name: &str,
opts: &SpawnOptions
) -> ReturnCode
pub fn is_spawning(&self) -> bool
pub fn recycle_creep(&self, target: &Creep) -> ReturnCode
pub fn renew_creep(&self, target: &Creep) -> ReturnCode
Trait Implementations
sourceimpl AsRef<Reference> for StructureSpawn
impl AsRef<Reference> for StructureSpawn
sourceimpl Attackable for StructureSpawn
impl Attackable for StructureSpawn
sourceimpl Clone for StructureSpawn
impl Clone for StructureSpawn
sourcefn clone(&self) -> StructureSpawn
fn clone(&self) -> StructureSpawn
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<StructureSpawn> for Reference
impl From<StructureSpawn> for Reference
sourcefn from(value: StructureSpawn) -> Self
fn from(value: StructureSpawn) -> Self
Converts to this type from the input type.
sourceimpl FromExpectedType<Reference> for StructureSpawn
impl FromExpectedType<Reference> for StructureSpawn
fn from_expected_type(reference: Reference) -> Result<Self, ConversionError>
sourceimpl HasId for StructureSpawn
impl HasId for StructureSpawn
sourcefn untyped_id(&self) -> RawObjectId
fn untyped_id(&self) -> RawObjectId
Retrieves this object’s id as an untyped, packed value. Read more
sourceimpl HasStore for StructureSpawn
impl HasStore for StructureSpawn
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
sourceimpl InstanceOf for StructureSpawn
impl InstanceOf for StructureSpawn
sourcefn instance_of(reference: &Reference) -> bool
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
sourceimpl OwnedStructureProperties for StructureSpawn
impl OwnedStructureProperties for StructureSpawn
sourcefn has_owner(&self) -> bool
fn has_owner(&self) -> bool
Whether this structure is currently owned by someone (in JS: owner !== undefined
) Read more
sourcefn owner_name(&self) -> Option<String>
fn owner_name(&self) -> Option<String>
The name of the owner of this structure, if any.
sourcefn as_owned_structure(self) -> OwnedStructurewhere
Self: SizedRoomObject,
fn as_owned_structure(self) -> OwnedStructurewhere
Self: SizedRoomObject,
Anonymize this as an owned structure.
sourceimpl PartialEq<StructureSpawn> for StructureSpawn
impl PartialEq<StructureSpawn> for StructureSpawn
sourcefn eq(&self, other: &StructureSpawn) -> bool
fn eq(&self, other: &StructureSpawn) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl ReferenceType for StructureSpawn
impl ReferenceType for StructureSpawn
sourceunsafe fn from_reference_unchecked(reference: Reference) -> Self
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts a given reference into a concrete reference-like wrapper. Doesn’t do any type checking; highly unsafe to use! Read more
sourceimpl RoomObjectProperties for StructureSpawn
impl RoomObjectProperties for StructureSpawn
sourceimpl StructureProperties for StructureSpawn
impl StructureProperties for StructureSpawn
fn structure_type(&self) -> StructureType
fn destroy(&self) -> ReturnCode
fn is_active(&self) -> bool
sourcefn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode
fn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode
Usable on either owned structures or neutral structures in owned rooms,
returns ReturnCode::NotOwner
otherwise. Read more
fn as_structure(self) -> Structurewhere
Self: SizedRoomObject,
sourceimpl<'_r> TryFrom<&'_r Reference> for StructureSpawn
impl<'_r> TryFrom<&'_r Reference> for StructureSpawn
sourceimpl<'_r> TryFrom<&'_r Value> for StructureSpawn
impl<'_r> TryFrom<&'_r Value> for StructureSpawn
sourceimpl TryFrom<Reference> for StructureSpawn
impl TryFrom<Reference> for StructureSpawn
sourceimpl TryFrom<StructureSpawn> for Reference
impl TryFrom<StructureSpawn> for Reference
sourceimpl TryFrom<Value> for StructureSpawn
impl TryFrom<Value> for StructureSpawn
impl Eq for StructureSpawn
impl HasEnergyForSpawn for StructureSpawn
impl JsSerialize for StructureSpawn
impl Transferable for StructureSpawn
impl Withdrawable for StructureSpawn
Auto Trait Implementations
impl RefUnwindSafe for StructureSpawn
impl Send for StructureSpawn
impl Sync for StructureSpawn
impl Unpin for StructureSpawn
impl UnwindSafe for StructureSpawn
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromExpectedType<Value> for Twhere
T: FromExpectedType<Reference>,
impl<T> FromExpectedType<Value> for Twhere
T: FromExpectedType<Reference>,
fn from_expected_type(v: Value) -> Result<T, ConversionError>
sourceimpl<T> HasPosition for Twhere
T: RoomObjectProperties,
impl<T> HasPosition for Twhere
T: RoomObjectProperties,
sourceimpl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
impl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
sourcefn into_expected_type(self) -> Result<U, ConversionError>
fn into_expected_type(self) -> Result<U, ConversionError>
Casts this value as the target type, making the assumption that the types are correct. Read more