Struct BaseUnitType

Source
pub struct BaseUnitType {
Show 60 fields pub id: UnitTypeID, pub string_id: StringKey, pub unit_class: UnitClass, pub standing_sprite_1: Option<SpriteID>, pub standing_sprite_2: Option<SpriteID>, pub dying_sprite: Option<SpriteID>, pub undead_sprite: Option<SpriteID>, pub undead_flag: u8, pub hp: u16, pub los: f32, pub garrison_capacity: u8, pub radius: (f32, f32, f32), pub train_sound: Option<SoundID>, pub damage_sound: Option<SoundID>, pub death_spawn: Option<UnitTypeID>, pub sort_number: u8, pub can_be_built_on: bool, pub button_picture: Option<GraphicID>, pub hide_in_scenario_editor: bool, pub portrait_picture: Option<GraphicID>, pub enabled: bool, pub disabled: bool, pub tile_req: (i16, i16), pub center_tile_req: (i16, i16), pub construction_radius: (f32, f32), pub elevation_flag: bool, pub fog_flag: bool, pub terrain_restriction_id: u16, pub movement_type: u8, pub attribute_max_amount: u16, pub attribute_rot: f32, pub area_effect_level: u8, pub combat_level: u8, pub select_level: u8, pub map_draw_level: u8, pub unit_level: u8, pub multiple_attribute_mod: f32, pub map_color: u8, pub help_string_id: StringKey, pub help_page_id: u32, pub hotkey_id: u32, pub recyclable: bool, pub track_as_resource: bool, pub create_doppleganger: bool, pub resource_group: u8, pub occlusion_mask: u8, pub obstruction_type: u8, pub selection_shape: u8, pub object_flags: u32, pub civilization: u8, pub attribute_piece: u8, pub outline_radius: (f32, f32, f32), pub attributes: ArrayVec<[UnitAttribute; 3]>, pub damage_sprites: Vec<DamageSprite>, pub selected_sound: Option<SoundID>, pub death_sound: Option<SoundID>, pub attack_reaction: u8, pub convert_terrain_flag: u8, pub copy_id: u16, pub unit_group: u16, /* private fields */
}

Fields§

§id: UnitTypeID§string_id: StringKey§unit_class: UnitClass§standing_sprite_1: Option<SpriteID>§standing_sprite_2: Option<SpriteID>§dying_sprite: Option<SpriteID>§undead_sprite: Option<SpriteID>§undead_flag: u8§hp: u16§los: f32§garrison_capacity: u8§radius: (f32, f32, f32)§train_sound: Option<SoundID>§damage_sound: Option<SoundID>§death_spawn: Option<UnitTypeID>§sort_number: u8§can_be_built_on: bool§button_picture: Option<GraphicID>§hide_in_scenario_editor: bool§portrait_picture: Option<GraphicID>§enabled: bool§disabled: bool§tile_req: (i16, i16)§center_tile_req: (i16, i16)§construction_radius: (f32, f32)§elevation_flag: bool§fog_flag: bool§terrain_restriction_id: u16§movement_type: u8§attribute_max_amount: u16§attribute_rot: f32§area_effect_level: u8§combat_level: u8§select_level: u8§map_draw_level: u8§unit_level: u8§multiple_attribute_mod: f32§map_color: u8§help_string_id: StringKey§help_page_id: u32§hotkey_id: u32§recyclable: bool§track_as_resource: bool§create_doppleganger: bool§resource_group: u8§occlusion_mask: u8§obstruction_type: u8§selection_shape: u8§object_flags: u32§civilization: u8§attribute_piece: u8§outline_radius: (f32, f32, f32)§attributes: ArrayVec<[UnitAttribute; 3]>§damage_sprites: Vec<DamageSprite>§selected_sound: Option<SoundID>§death_sound: Option<SoundID>§attack_reaction: u8§convert_terrain_flag: u8§copy_id: u16§unit_group: u16

Implementations§

Source§

impl BaseUnitType

Source

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

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 BaseUnitType

Source§

fn clone(&self) -> BaseUnitType

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 BaseUnitType

Source§

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

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

impl Default for BaseUnitType

Source§

fn default() -> BaseUnitType

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

impl From<BaseUnitType> for UnitType

Source§

fn from(v: BaseUnitType) -> 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<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.