Struct Unit

Source
pub struct Unit {
    pub ai_id: i32,
    pub unit_id: i32,
}

Fields§

§ai_id: i32§unit_id: i32

Implementations§

Source§

impl Unit

Source

pub fn select( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn attack( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn attack_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

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>>

Source

pub fn capture( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn capture_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

pub fn cloak( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, cloak: bool, ) -> Result<(), &'static str>

Source

pub fn custom_command( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, parameters: Vec<f32>, ) -> Result<(), &'static str>

Source

pub fn dgun_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn fight<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: P, ) -> Result<(), &'static str>

Source

pub fn guard( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn load_onto( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn load_units( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, targets: &[Unit], ) -> Result<(), &'static str>

Source

pub fn load_units_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

pub fn move_unit<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, to_pos: P, ) -> Result<(), Box<dyn Error>>

Source

pub fn patrol<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, to_pos: P, ) -> Result<(), Box<dyn Error>>

Source

pub fn reclaim_area<P: Position>( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: P, radius: f32, ) -> Result<(), &'static str>

Source

pub fn reclaim_feature( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Feature, ) -> Result<(), &'static str>

Source

pub fn reclaim_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn repair_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn restore_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

pub fn resurrect_unit( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, target: Unit, ) -> Result<(), &'static str>

Source

pub fn resurrect_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

pub fn self_destruct( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn set_auto_repair_level( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, auto_repair_level: i32, ) -> Result<(), &'static str>

Source

pub fn set_base_command( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, base_position: [f32; 3], ) -> Result<(), &'static str>

Source

pub fn set_fire_state( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, fire_state: FireState, ) -> Result<(), &'static str>

Source

pub fn set_idle_mode( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, idle_mode: IdleMode, ) -> Result<(), &'static str>

Source

pub fn set_move_state( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, move_state: MoveState, ) -> Result<(), &'static str>

Source

pub fn set_on_off( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, on: bool, ) -> Result<(), &'static str>

Source

pub fn set_repeat( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, repeat: bool, ) -> Result<(), &'static str>

Source

pub fn set_trajectory( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, trajectory: Trajectory, ) -> Result<(), &'static str>

Source

pub fn stockpile( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn stop( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn unload( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], to_unload_unit: Unit, ) -> Result<(), &'static str>

Source

pub fn unload_area( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, position: [f32; 3], radius: f32, ) -> Result<(), &'static str>

Source

pub fn wait( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn wait_death( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn wait_gather( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, ) -> Result<(), &'static str>

Source

pub fn wait_squad( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, num_units: i32, ) -> Result<(), &'static str>

Source

pub fn wait_time( &self, options: &[UnitCommandOptions], command_id: Option<i32>, timeout: Option<i32>, time: i32, ) -> Result<(), &'static str>

Source§

impl Unit

Source

pub fn unit_def(&self) -> Result<UnitDef, Box<dyn Error>>

Source

pub fn team(&self) -> Result<Team, Box<dyn Error>>

Source

pub fn get_stockpile(&self) -> Result<i32, Box<dyn Error>>

Source

pub fn stockpile_queued(&self) -> Result<i32, Box<dyn Error>>

Source

pub fn max_speed(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn max_range(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn max_health(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn max_experience(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn health(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn speed(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn power(&self) -> Result<f32, Box<dyn Error>>

Source

pub fn resource_use(&self, resource: Resource) -> Result<f32, Box<dyn Error>>

Source

pub fn resource_make(&self, resource: Resource) -> Result<f32, Box<dyn Error>>

Source

pub fn position(&self) -> Result<[f32; 3], Box<dyn Error>>

Source

pub fn velocity(&self) -> Result<[f32; 3], Box<dyn Error>>

Source

pub fn is_activated(&self) -> Result<bool, Box<dyn Error>>

Source

pub fn is_being_built(&self) -> Result<bool, Box<dyn Error>>

Source

pub fn is_cloaked(&self) -> Result<bool, Box<dyn Error>>

Source

pub fn is_paralyzed(&self) -> Result<bool, Box<dyn Error>>

Source

pub fn is_neutral(&self) -> Result<bool, Box<dyn Error>>

Source

pub fn facing(&self) -> Result<Facing, Box<dyn Error>>

Source

pub fn last_order_frame(&self) -> Result<i32, Box<dyn Error>>

Source

pub fn weapons(&self) -> Result<Vec<UnitWeapon>, Box<dyn Error>>

Source

pub fn group(&self) -> Result<Option<Group>, Box<dyn Error>>

Source

pub fn command_queue_type(&self) -> Result<i32, Box<dyn Error>>

Source

pub fn current_commands( &self, ) -> Result<Vec<UnitCurrentCommand>, Box<dyn Error>>

Source

pub fn supported_commands( &self, ) -> Result<Vec<UnitSupportedCommand>, Box<dyn Error>>

Source

pub fn get_nearest_enemy( &self, radius: f32, spherical: bool, ) -> Result<Option<Unit>, Box<dyn Error>>

Source

pub fn all(&self) -> Result<UnitAll, Box<dyn Error>>

Trait Implementations§

Source§

impl Clone for Unit

Source§

fn clone(&self) -> Unit

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Unit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Unit

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Unit

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Unit

Source§

fn eq(&self, other: &Unit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Unit

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for Unit

Source§

impl Eq for Unit

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,