Struct CombatUnitType

Source
pub struct CombatUnitType {
Show 16 fields pub costs: ArrayVec<[AttributeCost; 3]>, pub create_time: u16, pub create_at_building: Option<UnitTypeID>, pub create_button: i8, pub rear_attack_modifier: f32, pub flank_attack_modifier: f32, pub hero_flag: u8, pub garrison_sprite: Option<SpriteID>, pub volley_fire_amount: f32, pub max_attacks_in_volley: i8, pub volley_spread: (f32, f32), pub volley_start_spread_adjustment: f32, pub volley_missile: Option<UnitTypeID>, pub special_attack_sprite: Option<SpriteID>, pub special_attack_flag: i8, pub displayed_pierce_armor: i16, /* private fields */
}

Fields§

§costs: ArrayVec<[AttributeCost; 3]>

The costs of creating a unit of this type.

§create_time: u16§create_at_building: Option<UnitTypeID>

Unit type ID of the building or unit where this unit can be created.

§create_button: i8

Button location index where the button to create this unit should be shown when a create_at_building unit is selected.

§rear_attack_modifier: f32§flank_attack_modifier: f32§hero_flag: u8

Is this unit a hero unit?

TODO what is special about hero units? Does it just opt into the healing behaviour?

§garrison_sprite: Option<SpriteID>§volley_fire_amount: f32§max_attacks_in_volley: i8§volley_spread: (f32, f32)§volley_start_spread_adjustment: f32§volley_missile: Option<UnitTypeID>§special_attack_sprite: Option<SpriteID>§special_attack_flag: i8§displayed_pierce_armor: i16

Implementations§

Source§

impl CombatUnitType

Source

pub fn read_from(input: impl Read, version: f32) -> Result<Self>

Read this unit type from an input stream.

Source

pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>

Write this unit type to an output stream.

Methods from Deref<Target = BaseCombatUnitType>§

Source

pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>

Write this unit type to an output stream.

Methods from Deref<Target = ActionUnitType>§

Source

pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>

Write this unit type to an output stream.

Methods from Deref<Target = MovingUnitType>§

Source

pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>

Write this unit type to an output stream.

Methods from Deref<Target = AnimatedUnitType>§

Source

pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>

Write this unit type to an output stream.

Methods from Deref<Target = BaseUnitType>§

Source

pub fn write_to(&self, output: impl Write, _version: f32) -> Result<()>

Write this unit type to an output stream.

Trait Implementations§

Source§

impl Clone for CombatUnitType

Source§

fn clone(&self) -> CombatUnitType

Returns a copy 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 CombatUnitType

Source§

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

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

impl Default for CombatUnitType

Source§

fn default() -> CombatUnitType

Returns the “default value” for a type. Read more
Source§

impl Deref for CombatUnitType

Source§

type Target = BaseCombatUnitType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<CombatUnitType> for UnitType

Source§

fn from(v: CombatUnitType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.