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