Struct sc2::Unit [] [src]

pub struct Unit {
    pub display_type: DisplayType,
    pub alliance: Alliance,
    pub tag: Tag,
    pub unit_type: UnitType,
    pub owner: i32,
    pub pos: Point3,
    pub facing: f32,
    pub radius: f32,
    pub build_progress: f32,
    pub cloak: CloakState,
    pub detect_range: f32,
    pub radar_range: f32,
    pub is_selected: bool,
    pub is_on_screen: bool,
    pub is_blip: bool,
    pub health: f32,
    pub health_max: f32,
    pub shield: f32,
    pub energy: f32,
    pub mineral_contents: i32,
    pub vespene_contents: i32,
    pub is_flying: bool,
    pub is_burrowed: bool,
    pub weapon_cooldown: f32,
    pub orders: Vec<UnitOrder>,
    pub add_on_tag: Tag,
    pub passengers: Vec<PassengerUnit>,
    pub cargo_space_taken: i32,
    pub cargo_space_max: i32,
    pub assigned_harvesters: i32,
    pub ideal_harvesters: i32,
    pub engaged_target_tag: Tag,
    pub buffs: Vec<Buff>,
    pub is_powered: bool,
    pub is_alive: bool,
    pub last_seen_game_loop: u32,
}

a unit (could be structure, a worker, or military)

Fields

whether the unit is shown on screen or not

relationship of the unit to this player

a unique id for the instance of a unit

the type of unit

which player owns this unit

position of the unit in the world

direction the unit faces in radians

radius of the unit

gives progress under construction (range [0.0, 1.0] where 1.0 is done)

whether the unit is cloaked

range of detector for detector units

range of radar for radar units

whether this unit is currently selected

whether this unit is visible and within the camera frustum

whether this unit is detected by a sensor tower

health of the unit (not set for snapshots)

max health of the unit (not set for snapshots)

shield of the unit (not set for snapshots)

energy of the unit (not set for snapshots)

amount of minerals if unit is a mineral field (not set for snapshot)

amount of vespene if unit is a geyser (not set for snapshots)

whether the unit is flying (not set for snapshots)

whether the unit is burrowed (not set for snapshots)

time remaining for a weapon on cooldown (not set for snapshots)

orders on this unit (only valid for this player's units)

addon like a tech lab or reactor (only valid for this player's units)

passengers in this transport (only valid for this player's units)

number of cargo slots used (only valid for this player's units)

max number of cargo slots (only valid for this player's units)

number of harvesters associated with town hall

number of harvesters that can be assigned to a town hall

target unit of a unit (only valid for this player's units)

buffs on this unit (only valid for this player's units)

whether this unit is powered by a pylon

whether this unit is alive or not

the last time the unit was seen

Methods

impl Unit
[src]

[src]

mark this unit as dead

Trait Implementations

impl Debug for Unit
[src]

[src]

Formats the value using the given formatter.

impl Clone for Unit
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more