Removes derive-getters, as it was incredibly annoying in IDEs, and couldn't figure out borrow lifetimes.

This commit is contained in:
2022-06-06 14:43:41 +02:00
parent ce33ec0649
commit c27ea0ae1e
16 changed files with 395 additions and 57 deletions

View File

@@ -3,10 +3,9 @@ use crate::static_data::species_data::ability_index::AbilityIndex;
use crate::static_data::statistic_set::StatisticSet;
use crate::static_data::statistics::Statistic;
use crate::utils::random::Random;
use derive_getters::Getters;
use hashbrown::HashSet;
#[derive(Getters, Debug)]
#[derive(Debug)]
pub struct Form<'a> {
name: String,
height: f32,
@@ -47,6 +46,37 @@ impl<'a> Form<'a> {
}
}
pub fn name(&self) -> &str {
&self.name
}
pub fn height(&self) -> f32 {
self.height
}
pub fn weight(&self) -> f32 {
self.weight
}
pub fn base_experience(&self) -> u32 {
self.base_experience
}
pub fn types(&self) -> &Vec<u8> {
&self.types
}
pub fn base_stats(&self) -> StatisticSet<u16> {
self.base_stats
}
pub fn abilities(&self) -> &Vec<String> {
&self.abilities
}
pub fn hidden_abilities(&self) -> &Vec<String> {
&self.hidden_abilities
}
pub fn moves(&self) -> &LearnableMoves<'a> {
&self.moves
}
pub fn flags(&self) -> &HashSet<String> {
&self.flags
}
pub fn get_type(&self, index: usize) -> u8 {
self.types[index]
}