pub enum UnitType {
Base(Box<BaseUnitType>),
Tree(Box<TreeUnitType>),
Animated(Box<AnimatedUnitType>),
Doppleganger(Box<DopplegangerUnitType>),
Moving(Box<MovingUnitType>),
Action(Box<ActionUnitType>),
BaseCombat(Box<BaseCombatUnitType>),
Missile(Box<MissileUnitType>),
Combat(Box<CombatUnitType>),
Building(Box<BuildingUnitType>),
}
Variants§
Base(Box<BaseUnitType>)
The base unit type, for units that do not do anything.
Tree(Box<TreeUnitType>)
The tree unit type.
Animated(Box<AnimatedUnitType>)
Unit type that supports animated sprites.
Doppleganger(Box<DopplegangerUnitType>)
Unit type for the “fake” units you see in the fog of war, after the actual unit has been destroyed.
Moving(Box<MovingUnitType>)
Unit type that supports movement.
Action(Box<ActionUnitType>)
Unit type that supports being tasked by a player.
BaseCombat(Box<BaseCombatUnitType>)
Unit type that supports combat.
Missile(Box<MissileUnitType>)
Unit type for projectiles/missiles/arrows.
Combat(Box<CombatUnitType>)
Unit type that supports combat (with additional Age of Empires specific data).
Building(Box<BuildingUnitType>)
Unit type for buildings.
Implementations§
Source§impl UnitType
impl UnitType
Sourcepub fn read_from(input: impl Read, version: f32) -> Result<Self>
pub fn read_from(input: impl Read, version: f32) -> Result<Self>
Read a unit type from an input stream.
Sourcepub fn write_to(&self, output: impl Write, version: f32) -> Result<()>
pub fn write_to(&self, output: impl Write, version: f32) -> Result<()>
Write this unit type to an output stream.
Sourcepub fn base(&self) -> &BaseUnitType
pub fn base(&self) -> &BaseUnitType
Get the base unit type properties for this unit.
Sourcepub fn animated(&self) -> Option<&AnimatedUnitType>
pub fn animated(&self) -> Option<&AnimatedUnitType>
Get the animated unit type properties for this unit.
Sourcepub fn moving(&self) -> Option<&MovingUnitType>
pub fn moving(&self) -> Option<&MovingUnitType>
Get the moving unit type properties for this unit.
Sourcepub fn action(&self) -> Option<&ActionUnitType>
pub fn action(&self) -> Option<&ActionUnitType>
Get the action unit type properties for this unit.
Trait Implementations§
Source§impl From<ActionUnitType> for UnitType
impl From<ActionUnitType> for UnitType
Source§fn from(v: ActionUnitType) -> Self
fn from(v: ActionUnitType) -> Self
Converts to this type from the input type.
Source§impl From<AnimatedUnitType> for UnitType
impl From<AnimatedUnitType> for UnitType
Source§fn from(v: AnimatedUnitType) -> Self
fn from(v: AnimatedUnitType) -> Self
Converts to this type from the input type.
Source§impl From<BaseCombatUnitType> for UnitType
impl From<BaseCombatUnitType> for UnitType
Source§fn from(v: BaseCombatUnitType) -> Self
fn from(v: BaseCombatUnitType) -> Self
Converts to this type from the input type.
Source§impl From<BaseUnitType> for UnitType
impl From<BaseUnitType> for UnitType
Source§fn from(v: BaseUnitType) -> Self
fn from(v: BaseUnitType) -> Self
Converts to this type from the input type.
Source§impl From<BuildingUnitType> for UnitType
impl From<BuildingUnitType> for UnitType
Source§fn from(v: BuildingUnitType) -> Self
fn from(v: BuildingUnitType) -> Self
Converts to this type from the input type.
Source§impl From<CombatUnitType> for UnitType
impl From<CombatUnitType> for UnitType
Source§fn from(v: CombatUnitType) -> Self
fn from(v: CombatUnitType) -> Self
Converts to this type from the input type.
Source§impl From<DopplegangerUnitType> for UnitType
impl From<DopplegangerUnitType> for UnitType
Source§fn from(v: DopplegangerUnitType) -> Self
fn from(v: DopplegangerUnitType) -> Self
Converts to this type from the input type.
Source§impl From<MissileUnitType> for UnitType
impl From<MissileUnitType> for UnitType
Source§fn from(v: MissileUnitType) -> Self
fn from(v: MissileUnitType) -> Self
Converts to this type from the input type.
Source§impl From<MovingUnitType> for UnitType
impl From<MovingUnitType> for UnitType
Source§fn from(v: MovingUnitType) -> Self
fn from(v: MovingUnitType) -> Self
Converts to this type from the input type.
Source§impl From<TreeUnitType> for UnitType
impl From<TreeUnitType> for UnitType
Source§fn from(v: TreeUnitType) -> Self
fn from(v: TreeUnitType) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for UnitType
impl RefUnwindSafe for UnitType
impl Send for UnitType
impl Sync for UnitType
impl Unpin for UnitType
impl UnwindSafe for UnitType
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