[][src]Struct screeps_api::websocket::objects::StructureController

pub struct StructureController {
    pub id: String,
    pub room: RoomName,
    pub x: u32,
    pub y: u32,
    pub hits: i32,
    pub hits_max: i32,
    pub progress: u64,
    pub progress_total: u64,
    pub level: u16,
    pub reservation: Option<ControllerReservation>,
    pub safe_mode: Option<u32>,
    pub safe_mode_available: u32,
    pub safe_mode_cooldown: u32,
    pub downgrade_time: Option<u64>,
    pub sign: Option<RoomSign>,
    pub upgrade_blocked: Option<u32>,
    pub user: Option<String>,
}

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.

See also StructureController::progress_required_at_level.

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.

See also StructureController::total_downgrade_time_at_level

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]

impl Clone for 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]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,