Struct screeps::objects::PowerCreep
source · [−]pub struct PowerCreep(_);
Implementations
sourceimpl PowerCreep
impl PowerCreep
pub fn create(name: &str, class: PowerCreepClass) -> ReturnCode
pub fn class(&self) -> PowerCreepClass
pub fn power_cooldown(&self, power_type: PowerType) -> Option<u32>
pub fn power_keys(&self) -> Vec<PowerType>
pub fn power_level(&self, power_type: PowerType) -> Option<u8>
pub fn use_power<T>(
&self,
power_type: PowerType,
target: Option<&T>
) -> ReturnCodewhere
T: ?Sized + RoomObjectProperties,
pub fn upgrade(&self, power_type: PowerType) -> ReturnCode
sourceimpl PowerCreep
impl PowerCreep
pub fn renew<T>(&self, target: &T) -> ReturnCodewhere
T: ?Sized + StructureProperties,
sourceimpl PowerCreep
impl PowerCreep
pub fn enable_room(&self, target: &StructureController) -> ReturnCode
Trait Implementations
sourceimpl AsRef<Reference> for PowerCreep
impl AsRef<Reference> for PowerCreep
sourceimpl Attackable for PowerCreep
impl Attackable for PowerCreep
sourceimpl Clone for PowerCreep
impl Clone for PowerCreep
sourcefn clone(&self) -> PowerCreep
fn clone(&self) -> PowerCreep
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<PowerCreep> for Reference
impl From<PowerCreep> for Reference
sourcefn from(value: PowerCreep) -> Self
fn from(value: PowerCreep) -> Self
Converts to this type from the input type.
sourceimpl FromExpectedType<Reference> for PowerCreep
impl FromExpectedType<Reference> for PowerCreep
fn from_expected_type(reference: Reference) -> Result<Self, ConversionError>
sourceimpl HasId for PowerCreep
impl HasId for PowerCreep
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 PowerCreep
impl HasStore for PowerCreep
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 PowerCreep
impl InstanceOf for PowerCreep
sourcefn instance_of(reference: &Reference) -> bool
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
sourceimpl PartialEq<PowerCreep> for PowerCreep
impl PartialEq<PowerCreep> for PowerCreep
sourcefn eq(&self, other: &PowerCreep) -> bool
fn eq(&self, other: &PowerCreep) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl ReferenceType for PowerCreep
impl ReferenceType for PowerCreep
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 PowerCreep
impl RoomObjectProperties for PowerCreep
fn cancel_order(&self, name: &str) -> ReturnCode
fn drop(&self, ty: ResourceType, amount: Option<u32>) -> ReturnCode
fn move_direction(&self, dir: Direction) -> ReturnCode
fn move_to_xy(&self, x: u32, y: u32) -> ReturnCode
fn move_to_xy_with_options<'a, F>(
&self,
x: u32,
y: u32,
move_options: MoveToOptions<'a, F>
) -> ReturnCodewhere
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a> + 'a,
fn move_to<T: ?Sized + HasPosition>(&self, target: &T) -> ReturnCode
fn move_to_with_options<'a, F, T>(
&self,
target: &T,
move_options: MoveToOptions<'a, F>
) -> ReturnCodewhere
T: ?Sized + HasPosition,
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a> + 'a,
fn move_by_path_serialized(&self, path: &str) -> ReturnCode
fn move_by_path_steps(&self, path: &[Step]) -> ReturnCode
fn move_by_path_search_result(&self, path: &SearchResults) -> ReturnCode
fn memory(&self) -> MemoryReference
fn my(&self) -> bool
fn name(&self) -> String
fn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode
fn owner_name(&self) -> String
fn pickup(&self, target: &Resource) -> ReturnCode
fn say(&self, msg: &str, public: bool) -> ReturnCode
fn saying(&self) -> String
fn suicide(&self) -> ReturnCode
fn ticks_to_live(&self) -> Result<u32, ConversionError>
fn transfer_amount<T>(
&self,
target: &T,
ty: ResourceType,
amount: u32
) -> ReturnCodewhere
T: ?Sized + Transferable,
fn transfer_all<T>(&self, target: &T, ty: ResourceType) -> ReturnCodewhere
T: ?Sized + Transferable,
fn withdraw_amount<T>(
&self,
target: &T,
ty: ResourceType,
amount: u32
) -> ReturnCodewhere
T: ?Sized + Withdrawable,
fn withdraw_all<T>(&self, target: &T, ty: ResourceType) -> ReturnCodewhere
T: ?Sized + Withdrawable,
sourceimpl<'_r> TryFrom<&'_r Reference> for PowerCreep
impl<'_r> TryFrom<&'_r Reference> for PowerCreep
sourceimpl<'_r> TryFrom<&'_r Value> for PowerCreep
impl<'_r> TryFrom<&'_r Value> for PowerCreep
sourceimpl TryFrom<PowerCreep> for Reference
impl TryFrom<PowerCreep> for Reference
sourceimpl TryFrom<Reference> for PowerCreep
impl TryFrom<Reference> for PowerCreep
sourceimpl TryFrom<Value> for PowerCreep
impl TryFrom<Value> for PowerCreep
impl Eq for PowerCreep
impl JsSerialize for PowerCreep
impl Transferable for PowerCreep
Auto Trait Implementations
impl RefUnwindSafe for PowerCreep
impl Send for PowerCreep
impl Sync for PowerCreep
impl Unpin for PowerCreep
impl UnwindSafe for PowerCreep
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