pub struct Unit {
pub ai_id: i32,
pub unit_id: i32,
}
Fields§
§ai_id: i32
§unit_id: i32
Implementations§
Source§impl Unit
impl Unit
pub fn select( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn attack( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn attack_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn build<P: Position, D: PartialEq<UnitDef>>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, to_build_unit_def: D, position: P, facing: Facing, ) -> Result<(), Box<dyn Error>>
pub fn capture( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn capture_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn cloak( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, cloak: bool, ) -> Result<(), &'static str>
pub fn custom_command( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, parameters: Vec<f32>, ) -> Result<(), &'static str>
pub fn dgun_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn fight<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: P, ) -> Result<(), &'static str>
pub fn guard( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn load_onto( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn load_units( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, targets: &[Unit], ) -> Result<(), &'static str>
pub fn load_units_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn move_unit<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, to_pos: P, ) -> Result<(), Box<dyn Error>>
pub fn patrol<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, to_pos: P, ) -> Result<(), Box<dyn Error>>
pub fn reclaim_area<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: P, radius: f32, ) -> Result<(), &'static str>
pub fn reclaim_feature( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Feature, ) -> Result<(), &'static str>
pub fn reclaim_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn repair_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn restore_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn resurrect_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>
pub fn resurrect_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn self_destruct( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn set_auto_repair_level( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, auto_repair_level: i32, ) -> Result<(), &'static str>
pub fn set_base_command( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, base_position: [f32; 3], ) -> Result<(), &'static str>
pub fn set_fire_state( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, fire_state: FireState, ) -> Result<(), &'static str>
pub fn set_idle_mode( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, idle_mode: IdleMode, ) -> Result<(), &'static str>
pub fn set_move_state( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, move_state: MoveState, ) -> Result<(), &'static str>
pub fn set_on_off( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, on: bool, ) -> Result<(), &'static str>
pub fn set_repeat( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, repeat: bool, ) -> Result<(), &'static str>
pub fn set_trajectory( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, trajectory: Trajectory, ) -> Result<(), &'static str>
pub fn stockpile( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn stop( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn unload( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], to_unload_unit: Unit, ) -> Result<(), &'static str>
pub fn unload_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>
pub fn wait( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn wait_death( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn wait_gather( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>
pub fn wait_squad( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, num_units: i32, ) -> Result<(), &'static str>
pub fn wait_time( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, time: i32, ) -> Result<(), &'static str>
Source§impl Unit
impl Unit
pub fn unit_def(&self) -> Result<UnitDef, Box<dyn Error>>
pub fn team(&self) -> Result<Team, Box<dyn Error>>
pub fn get_stockpile(&self) -> Result<i32, Box<dyn Error>>
pub fn stockpile_queued(&self) -> Result<i32, Box<dyn Error>>
pub fn max_speed(&self) -> Result<f32, Box<dyn Error>>
pub fn max_range(&self) -> Result<f32, Box<dyn Error>>
pub fn max_health(&self) -> Result<f32, Box<dyn Error>>
pub fn max_experience(&self) -> Result<f32, Box<dyn Error>>
pub fn health(&self) -> Result<f32, Box<dyn Error>>
pub fn speed(&self) -> Result<f32, Box<dyn Error>>
pub fn power(&self) -> Result<f32, Box<dyn Error>>
pub fn resource_use(&self, resource: Resource) -> Result<f32, Box<dyn Error>>
pub fn resource_make(&self, resource: Resource) -> Result<f32, Box<dyn Error>>
pub fn position(&self) -> Result<[f32; 3], Box<dyn Error>>
pub fn velocity(&self) -> Result<[f32; 3], Box<dyn Error>>
pub fn is_activated(&self) -> Result<bool, Box<dyn Error>>
pub fn is_being_built(&self) -> Result<bool, Box<dyn Error>>
pub fn is_cloaked(&self) -> Result<bool, Box<dyn Error>>
pub fn is_paralyzed(&self) -> Result<bool, Box<dyn Error>>
pub fn is_neutral(&self) -> Result<bool, Box<dyn Error>>
pub fn facing(&self) -> Result<Facing, Box<dyn Error>>
pub fn last_order_frame(&self) -> Result<i32, Box<dyn Error>>
pub fn weapons(&self) -> Result<Vec<UnitWeapon>, Box<dyn Error>>
pub fn group(&self) -> Result<Option<Group>, Box<dyn Error>>
pub fn command_queue_type(&self) -> Result<i32, Box<dyn Error>>
pub fn current_commands( &self, ) -> Result<Vec<UnitCurrentCommand>, Box<dyn Error>>
pub fn supported_commands( &self, ) -> Result<Vec<UnitSupportedCommand>, Box<dyn Error>>
pub fn get_nearest_enemy( &self, radius: f32, spherical: bool, ) -> Result<Option<Unit>, Box<dyn Error>>
pub fn all(&self) -> Result<UnitAll, Box<dyn Error>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Unit
impl<'de> Deserialize<'de> for Unit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Unit
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.