Enum MovableObject

Source
pub enum MovableObject {
    Creep(Creep),
    PowerCreep(PowerCreep),
}

Variants§

§

Creep(Creep)

§

PowerCreep(PowerCreep)

Trait Implementations§

Source§

impl From<Creep> for MovableObject

Source§

fn from(v: Creep) -> MovableObject

Converts to this type from the input type.
Source§

impl From<PowerCreep> for MovableObject

Source§

fn from(v: PowerCreep) -> MovableObject

Converts to this type from the input type.
Source§

impl SharedCreepProperties for MovableObject

Source§

fn memory(&self) -> JsValue

A shortcut to the part of the Memory tree used for this creep by default

Source§

fn set_memory(&self, __enum_dispatch_arg_0: &JsValue)

Sets a new value to the memory object shortcut for this creep.

Source§

fn my(&self) -> bool

Whether this creep is owned by the player.

Source§

fn name(&self) -> String

The creep’s name as a String.

Screeps documentation

Source§

fn name_jsstring(&self) -> JsString

The creep’s name as a JsString.

Screeps documentation

Source§

fn owner(&self) -> Owner

The Owner of this creep that contains the owner’s username.

Source§

fn saying(&self) -> Option<JsString>

What the creep said last tick.

Source§

fn ticks_to_live(&self) -> Option<u32>

The number of ticks the creep has left to live.

Source§

fn drop( &self, __enum_dispatch_arg_0: ResourceType, __enum_dispatch_arg_1: Option<u32>, ) -> Result<(), DropErrorCode>

Drop a resource on the ground from the creep’s Store.

Source§

fn notify_when_attacked( &self, __enum_dispatch_arg_0: bool, ) -> Result<(), NotifyWhenAttackedErrorCode>

Whether to send an email notification when this creep is attacked.

Source§

fn pickup( &self, __enum_dispatch_arg_0: &Resource, ) -> Result<(), PickupErrorCode>

Pick up a Resource in melee range (or at the same position as the creep).

Source§

fn say( &self, __enum_dispatch_arg_0: &str, __enum_dispatch_arg_1: bool, ) -> Result<(), SayErrorCode>

Display a string in a bubble above the creep next tick. 10 character limit.

Source§

fn suicide(&self) -> Result<(), SuicideErrorCode>

Immediately kill the creep.

Source§

fn transfer<T>( &self, __enum_dispatch_arg_0: &T, __enum_dispatch_arg_1: ResourceType, __enum_dispatch_arg_2: Option<u32>, ) -> Result<(), TransferErrorCode>
where T: Transferable + ?Sized,

Transfer a resource from the creep’s store to Structure, PowerCreep, or another Creep.

Source§

fn withdraw<T>( &self, __enum_dispatch_arg_0: &T, __enum_dispatch_arg_1: ResourceType, __enum_dispatch_arg_2: Option<u32>, ) -> Result<(), WithdrawErrorCode>
where T: Withdrawable + ?Sized,

Withdraw a resource from a Structure, Tombstone, or Ruin.

Source§

impl TryInto<Creep> for MovableObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Creep, <Self as TryInto<Creep>>::Error>

Performs the conversion.
Source§

impl TryInto<PowerCreep> for MovableObject

Source§

type Error = &'static str

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

fn try_into(self) -> Result<PowerCreep, <Self as TryInto<PowerCreep>>::Error>

Performs the conversion.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.