pub struct TechData {
pub abilities: Vec<Ability>,
pub unittypes: Vec<UnitType>,
pub upgrades: Vec<Upgrade>,
}
Expand description
All tech data
Fields§
§abilities: Vec<Ability>
All abilities
unittypes: Vec<UnitType>
All unit types
upgrades: Vec<Upgrade>
All upgrades
Implementations§
Source§impl TechData
impl TechData
Sourcepub fn from_json(source: &str) -> Result<Self, DeserializeError>
pub fn from_json(source: &str) -> Result<Self, DeserializeError>
Load data from a json string
Sourcepub fn unittype(&self, unittype_id: UnitTypeId) -> Option<UnitType>
pub fn unittype(&self, unittype_id: UnitTypeId) -> Option<UnitType>
Get a unit type by id
Sourcepub fn upgrade_ability(
&self,
upgrade_id: UpgradeId,
) -> Result<Ability, QueryError>
pub fn upgrade_ability( &self, upgrade_id: UpgradeId, ) -> Result<Ability, QueryError>
Ability that researches an upgrade
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TechData
impl<'de> Deserialize<'de> for TechData
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
impl Eq for TechData
impl StructuralPartialEq for TechData
Auto Trait Implementations§
impl Freeze for TechData
impl RefUnwindSafe for TechData
impl Send for TechData
impl Sync for TechData
impl Unpin for TechData
impl UnwindSafe for TechData
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