pub struct UnitDef {
pub ai_id: i32,
pub def_id: i32,
}
Fields§
§ai_id: i32
§def_id: i32
Implementations§
Source§impl UnitDef
impl UnitDef
pub fn weapon_mounts(&self) -> Result<Vec<UnitWeaponMount>, Box<dyn Error>>
Source§impl UnitDef
impl UnitDef
pub fn name(&self) -> Result<String, Box<dyn Error>>
pub fn display_name(&self) -> Result<String, Box<dyn Error>>
pub fn kind(&self) -> Result<UnitDefKind, Box<dyn Error>>
pub fn model(&self) -> UnitModel
pub fn resource(&self, resource: Resource) -> UnitResource
pub fn construction(&self) -> UnitConstruction
pub fn auto_heal(&self) -> UnitAutoHeal
pub fn movement(&self) -> UnitMovement
pub fn vision(&self) -> UnitVision
pub fn detection(&self) -> UnitDetection
pub fn building(&self) -> UnitBuilding
pub fn flanking(&self) -> UnitFlanking
pub fn combat(&self) -> UnitCombat
pub fn death(&self) -> UnitDeath
pub fn aircraft(&self) -> UnitAircraft
pub fn transport(&self) -> UnitTransport
pub fn cloak(&self) -> UnitCloak
pub fn flare(&self) -> UnitFlare
pub fn miscellaneous(&self) -> UnitMiscellaneous
pub fn all(&self) -> Result<UnitDefAll, Box<dyn Error>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UnitDef
impl<'de> Deserialize<'de> for UnitDef
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
Source§impl PartialEq<UnitDef> for UnitDefKind
impl PartialEq<UnitDef> for UnitDefKind
Source§impl PartialEq<UnitDefKind> for UnitDef
impl PartialEq<UnitDefKind> for UnitDef
impl Copy for UnitDef
impl Eq for UnitDef
impl StructuralPartialEq for UnitDef
Auto Trait Implementations§
impl Freeze for UnitDef
impl RefUnwindSafe for UnitDef
impl Send for UnitDef
impl Sync for UnitDef
impl Unpin for UnitDef
impl UnwindSafe for UnitDef
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.