Struct sc2::data::Unit [−][src]
pub struct Unit { /* fields omitted */ }
A unit (could be structure, a worker, or military).
Methods
impl Unit
[src]
impl Unit
pub fn mark_dead(&mut self)
[src]
pub fn mark_dead(&mut self)
Mark this unit as dead.
pub fn set_last_seen_step(&mut self, step: u32)
[src]
pub fn set_last_seen_step(&mut self, step: u32)
Set the step where the unit was last seen.
pub fn get_display_type(&self) -> DisplayType
[src]
pub fn get_display_type(&self) -> DisplayType
Whether the unit is shown on screen or not.
pub fn get_alliance(&self) -> Alliance
[src]
pub fn get_alliance(&self) -> Alliance
Relationship of the unit to this player.
pub fn get_tag(&self) -> Tag
[src]
pub fn get_tag(&self) -> Tag
A unique id for the instance of a unit.
pub fn get_unit_type(&self) -> UnitType
[src]
pub fn get_unit_type(&self) -> UnitType
The type of unit.
pub fn get_owner(&self) -> i32
[src]
pub fn get_owner(&self) -> i32
Which player owns this unit.
pub fn get_pos(&self) -> Point3
[src]
pub fn get_pos(&self) -> Point3
Position of the unit in the world.
pub fn get_pos_2d(&self) -> Point2
[src]
pub fn get_pos_2d(&self) -> Point2
Just the x and y coordinates of the unit position.
pub fn get_facing(&self) -> f32
[src]
pub fn get_facing(&self) -> f32
Direction the unit faces in radians.
pub fn get_radius(&self) -> f32
[src]
pub fn get_radius(&self) -> f32
Radius of the unit.
pub fn get_build_progress(&self) -> f32
[src]
pub fn get_build_progress(&self) -> f32
Gives progress under construction (range [0.0, 1.0] where 1.0 is done).
pub fn get_cloak_state(&self) -> CloakState
[src]
pub fn get_cloak_state(&self) -> CloakState
Whether the unit is cloaked.
pub fn get_detect_range(&self) -> f32
[src]
pub fn get_detect_range(&self) -> f32
Range of detector for detector units.
pub fn get_radar_range(&self) -> f32
[src]
pub fn get_radar_range(&self) -> f32
Range of radar for radar units.
pub fn is_selected(&self) -> bool
[src]
pub fn is_selected(&self) -> bool
Whether this unit is currently selected.
pub fn is_on_screen(&self) -> bool
[src]
pub fn is_on_screen(&self) -> bool
Whether this unit is visible and within the camera frustum.
pub fn is_blip(&self) -> bool
[src]
pub fn is_blip(&self) -> bool
Whether this unit is detected by a sensor tower.
pub fn get_health(&self) -> f32
[src]
pub fn get_health(&self) -> f32
Health of the unit (not set for snapshots).
pub fn get_health_cap(&self) -> f32
[src]
pub fn get_health_cap(&self) -> f32
Max health of the unit (not set for snapshots).
pub fn get_shield(&self) -> f32
[src]
pub fn get_shield(&self) -> f32
Shield of the unit (not set for snapshots).
pub fn get_energy(&self) -> f32
[src]
pub fn get_energy(&self) -> f32
Energy of the unit (not set for snapshots).
pub fn get_mineral_contents(&self) -> u32
[src]
pub fn get_mineral_contents(&self) -> u32
Amount of minerals if unit is a mineral field (not set for snapshot).
pub fn get_vespene_contents(&self) -> u32
[src]
pub fn get_vespene_contents(&self) -> u32
Amount of vespene if unit is a geyser (not set for snapshots).
pub fn is_flying(&self) -> bool
[src]
pub fn is_flying(&self) -> bool
Whether the unit is flying (not set for snapshots).
pub fn is_burrowed(&self) -> bool
[src]
pub fn is_burrowed(&self) -> bool
Whether the unit is burrowed (not set for snapshots).
pub fn get_weapon_cooldown(&self) -> f32
[src]
pub fn get_weapon_cooldown(&self) -> f32
Time remaining for a weapon on cooldown (not set for snapshots).
pub fn get_orders(&self) -> &[UnitOrder]
[src]
pub fn get_orders(&self) -> &[UnitOrder]
Orders on this unit (only valid for this player's units).
pub fn get_add_on_tag(&self) -> Tag
[src]
pub fn get_add_on_tag(&self) -> Tag
Addon like a tech lab or reactor (only valid for this player's units).
pub fn get_passengers(&self) -> &[PassengerUnit]
[src]
pub fn get_passengers(&self) -> &[PassengerUnit]
Passengers in this transport (only valid for this player's units).
pub fn get_cargo_space_taken(&self) -> u32
[src]
pub fn get_cargo_space_taken(&self) -> u32
Number of cargo slots used (only valid for this player's units).
pub fn get_cargo_space_cap(&self) -> u32
[src]
pub fn get_cargo_space_cap(&self) -> u32
Max number of cargo slots (only valid for this player's units).
pub fn get_assigned_harvesters(&self) -> u32
[src]
pub fn get_assigned_harvesters(&self) -> u32
Number of harvesters associated with town hall.
pub fn get_ideal_harvesters(&self) -> u32
[src]
pub fn get_ideal_harvesters(&self) -> u32
Number of harvesters that can be assigned to a town hall.
pub fn get_engaged_target_tag(&self) -> Tag
[src]
pub fn get_engaged_target_tag(&self) -> Tag
Target unit of a unit (only valid for this player's units).
pub fn get_buffs(&self) -> &[Buff]
[src]
pub fn get_buffs(&self) -> &[Buff]
Buffs on this unit (only valid for this player's units).
pub fn is_powered(&self) -> bool
[src]
pub fn is_powered(&self) -> bool
Whether this unit is powered by a pylon.
pub fn is_alive(&self) -> bool
[src]
pub fn is_alive(&self) -> bool
Whether this unit is alive or not.
pub fn get_last_seen_step(&self) -> u32
[src]
pub fn get_last_seen_step(&self) -> u32
The last time the unit was seen.
Trait Implementations
impl Debug for Unit
[src]
impl Debug for Unit
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Unit
[src]
impl Clone for Unit