Struct sc2::data::Unit [−][src]
pub struct Unit { /* fields omitted */ }A unit (could be structure, a worker, or military).
Methods
impl Unit[src]
impl Unitpub 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) -> DisplayTypeWhether the unit is shown on screen or not.
pub fn get_alliance(&self) -> Alliance[src]
pub fn get_alliance(&self) -> AllianceRelationship of the unit to this player.
pub fn get_tag(&self) -> Tag[src]
pub fn get_tag(&self) -> TagA unique id for the instance of a unit.
pub fn get_unit_type(&self) -> UnitType[src]
pub fn get_unit_type(&self) -> UnitTypeThe type of unit.
pub fn get_owner(&self) -> i32[src]
pub fn get_owner(&self) -> i32Which player owns this unit.
pub fn get_pos(&self) -> Point3[src]
pub fn get_pos(&self) -> Point3Position of the unit in the world.
pub fn get_pos_2d(&self) -> Point2[src]
pub fn get_pos_2d(&self) -> Point2Just the x and y coordinates of the unit position.
pub fn get_facing(&self) -> f32[src]
pub fn get_facing(&self) -> f32Direction the unit faces in radians.
pub fn get_radius(&self) -> f32[src]
pub fn get_radius(&self) -> f32Radius of the unit.
pub fn get_build_progress(&self) -> f32[src]
pub fn get_build_progress(&self) -> f32Gives 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) -> CloakStateWhether the unit is cloaked.
pub fn get_detect_range(&self) -> f32[src]
pub fn get_detect_range(&self) -> f32Range of detector for detector units.
pub fn get_radar_range(&self) -> f32[src]
pub fn get_radar_range(&self) -> f32Range of radar for radar units.
pub fn is_selected(&self) -> bool[src]
pub fn is_selected(&self) -> boolWhether this unit is currently selected.
pub fn is_on_screen(&self) -> bool[src]
pub fn is_on_screen(&self) -> boolWhether this unit is visible and within the camera frustum.
pub fn is_blip(&self) -> bool[src]
pub fn is_blip(&self) -> boolWhether this unit is detected by a sensor tower.
pub fn get_health(&self) -> f32[src]
pub fn get_health(&self) -> f32Health of the unit (not set for snapshots).
pub fn get_health_cap(&self) -> f32[src]
pub fn get_health_cap(&self) -> f32Max health of the unit (not set for snapshots).
pub fn get_shield(&self) -> f32[src]
pub fn get_shield(&self) -> f32Shield of the unit (not set for snapshots).
pub fn get_energy(&self) -> f32[src]
pub fn get_energy(&self) -> f32Energy of the unit (not set for snapshots).
pub fn get_mineral_contents(&self) -> u32[src]
pub fn get_mineral_contents(&self) -> u32Amount 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) -> u32Amount of vespene if unit is a geyser (not set for snapshots).
pub fn is_flying(&self) -> bool[src]
pub fn is_flying(&self) -> boolWhether the unit is flying (not set for snapshots).
pub fn is_burrowed(&self) -> bool[src]
pub fn is_burrowed(&self) -> boolWhether the unit is burrowed (not set for snapshots).
pub fn get_weapon_cooldown(&self) -> f32[src]
pub fn get_weapon_cooldown(&self) -> f32Time 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) -> TagAddon 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) -> u32Number 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) -> u32Max 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) -> u32Number of harvesters associated with town hall.
pub fn get_ideal_harvesters(&self) -> u32[src]
pub fn get_ideal_harvesters(&self) -> u32Number 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) -> TagTarget 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) -> boolWhether this unit is powered by a pylon.
pub fn is_alive(&self) -> bool[src]
pub fn is_alive(&self) -> boolWhether this unit is alive or not.
pub fn get_last_seen_step(&self) -> u32[src]
pub fn get_last_seen_step(&self) -> u32The last time the unit was seen.
Trait Implementations
impl Debug for Unit[src]
impl Debug for Unitfn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
fn fmt(&self, __arg_0: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Unit[src]
impl Clone for Unit