pub struct GameData {
pub monster_data: Info,
pub breed_formulae: Vec<Formula>,
pub skills: HashMap<String, Skill>,
}
Expand description
All DWM2 game data. This is the entry point of the whole library.
Fields§
§monster_data: Info
Data about monsters
breed_formulae: Vec<Formula>
All breed formulae
skills: HashMap<String, Skill>
All skills
Implementations§
source§impl GameData
impl GameData
sourcepub fn monstersWithSkill<'a>(
&'a self,
skill_name: &'a str
) -> impl Iterator<Item = &Monster> + 'a
pub fn monstersWithSkill<'a>( &'a self, skill_name: &'a str ) -> impl Iterator<Item = &Monster> + 'a
Find all monsters having a skill natrually.
sourcepub fn monstersInFamily<'a>(
&'a self,
family: &'a Family
) -> impl Iterator<Item = &Monster> + 'a
pub fn monstersInFamily<'a>( &'a self, family: &'a Family ) -> impl Iterator<Item = &Monster> + 'a
Find all monsters in a family.
sourcepub fn usedInFormulae<'a>(
&'a self,
parent: &'a Parent
) -> impl Iterator<Item = &Formula> + 'a
pub fn usedInFormulae<'a>( &'a self, parent: &'a Parent ) -> impl Iterator<Item = &Formula> + 'a
Find all the formulae a monster or a family is used in.
sourcepub fn breedFromFormulae<'a>(
&'a self,
offspring: &'a str
) -> impl Iterator<Item = &Formula> + 'a
pub fn breedFromFormulae<'a>( &'a self, offspring: &'a str ) -> impl Iterator<Item = &Formula> + 'a
Find all the formulae that produces a specific monster.
sourcepub fn skillUpgradePath<'a>(&'a self, skill: &'a Skill) -> Vec<&'a Skill>
pub fn skillUpgradePath<'a>(&'a self, skill: &'a Skill) -> Vec<&'a Skill>
Return the skill update path the skill is in. The result is arranged from weak to strong. Exmaple:
let content = include_bytes!("../../monster-data.xml");
let data = GameData::fromXML(content).unwrap();
let upgrade_path = data.skillUpgradePath(
data.skill("Infermore").unwrap());
assert_eq!(upgrade_path.iter().map(|s| &s.name).collect::<Vec<&String>>(),
vec!["Infernos", "Infermore", "Infermost"]);
sourcepub fn skillCombinesInto<'a>(
&'a self,
skill: &'a Skill
) -> impl Iterator<Item = &Skill> + 'a
pub fn skillCombinesInto<'a>( &'a self, skill: &'a Skill ) -> impl Iterator<Item = &Skill> + 'a
Return all the skills that skill
and its upgrades combines
into.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for GameData
impl Send for GameData
impl Sync for GameData
impl Unpin for GameData
impl UnwindSafe for GameData
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