[−][src]Struct screeps_api::websocket::objects::StructureController
A controller, an object creeps can upgrade in order to increase room level.
Fields
id: String
Unique 'id' identifier for all game objects on a server.
room: RoomName
Room object is in.
x: u32
X position within the room (0-50).
y: u32
Y position within the room (0-50).
hits: i32
The current number of hit-points this structure has.
hits_max: i32
The maximum number of hit-points this structure has.
progress: u64
The number of upgrade points the controller has.
progress_total: u64
The number of upgrade points needed before the next level is reached.
level: u16
The current controller level (1-8 inclusive).
reservation: Option<ControllerReservation>
Controller reservation.
safe_mode: Option<u32>
Game time at which the current safemode will end, if any.
safe_mode_available: u32
How many more safemodes are available.
safe_mode_cooldown: u32
The game time that must be reached before safe mode can be used on the controller.
May be in the past, in which safe mode may be used immediately.
downgrade_time: Option<u64>
The number of game ticks without an upgrade needed before the controller downgrades.
None if unowned.
sign: Option<RoomSign>
The room sign.
upgrade_blocked: Option<u32>
The number of ticks until upgrading is no longer blocked.
user: Option<String>
ID of the user who owns the controller, and thus the room.
Methods
impl StructureController
[src]
pub fn update(&mut self, update: StructureControllerUpdate)
[src]
Updates this structure with all values present in the given update.
impl StructureController
[src]
pub fn progress_required(&self) -> Option<u32>
[src]
The progress required for this controller's level (100% dependent on level
).
Returns None
if level is outside of 1..=7.
pub fn progress_required_at_level(level: u16) -> Option<u32>
[src]
Progress required for a level.
pub fn total_downgrade_time(&self) -> Option<u32>
[src]
The total downgrade time for this controller's level (100% dependent on level
)
Returns None
if level is outside of 1..=8.
pub fn total_downgrade_time_at_level(level: u16) -> Option<u32>
[src]
Total downgrade time for a level (game ticks since the last upgrade that this controller will loose a level).
Trait Implementations
impl PartialEq<StructureController> for StructureController
[src]
fn eq(&self, other: &StructureController) -> bool
[src]
fn ne(&self, other: &StructureController) -> bool
[src]
impl Clone for StructureController
[src]
fn clone(&self) -> StructureController
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for StructureController
[src]
impl<'de> Deserialize<'de> for StructureController
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for StructureController
impl Sync for StructureController
impl Send for StructureController
impl RefUnwindSafe for StructureController
impl UnwindSafe for StructureController
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,