pub enum MovableObject {
Creep(Creep),
PowerCreep(PowerCreep),
}
Variants§
Creep(Creep)
PowerCreep(PowerCreep)
Trait Implementations§
Source§impl From<Creep> for MovableObject
impl From<Creep> for MovableObject
Source§fn from(v: Creep) -> MovableObject
fn from(v: Creep) -> MovableObject
Converts to this type from the input type.
Source§impl From<PowerCreep> for MovableObject
impl From<PowerCreep> for MovableObject
Source§fn from(v: PowerCreep) -> MovableObject
fn from(v: PowerCreep) -> MovableObject
Converts to this type from the input type.
Source§fn memory(&self) -> JsValue
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)
fn set_memory(&self, __enum_dispatch_arg_0: &JsValue)
Sets a new value to the memory object shortcut for this creep.
Source§fn name_jsstring(&self) -> JsString
fn name_jsstring(&self) -> JsString
The creep’s name as a JsString
.
Source§fn ticks_to_live(&self) -> Option<u32>
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>
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>
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>
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>
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 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,
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,
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,
Source§impl TryInto<Creep> for MovableObject
impl TryInto<Creep> for MovableObject
Source§impl TryInto<PowerCreep> for MovableObject
impl TryInto<PowerCreep> for MovableObject
Auto Trait Implementations§
impl Freeze for MovableObject
impl RefUnwindSafe for MovableObject
impl !Send for MovableObject
impl !Sync for MovableObject
impl Unpin for MovableObject
impl UnwindSafe for MovableObject
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