Adding getters.

This commit is contained in:
Pcornat 2022-10-30 13:16:25 +01:00
parent b657e32cac
commit 4ed370d51f
Signed by: Pcornat
GPG Key ID: 2F3932FF46D9ECA0

View File

@ -30,6 +30,42 @@ pub struct CharacterSheet {
money: u32,
}
impl CharacterSheet {
pub fn character_class(&self) -> &Classe {
&self.character_class
}
pub fn character(&self) -> &str {
&self.character
}
pub fn address(&self) -> &Characteristic {
&self.address
}
pub fn stamina(&self) -> &Characteristic {
&self.stamina
}
pub fn luck(&self) -> &Characteristic {
&self.luck
}
pub fn skill(&self) -> &Characteristic {
&self.skill
}
pub fn health(&self) -> u32 {
self.health
}
pub fn armor(&self) -> u32 {
self.armor
}
pub fn damage(&self) -> u32 {
self.damage
}
pub fn glory(&self) -> u32 {
self.glory
}
pub fn money(&self) -> u32 {
self.money
}
}
#[derive(Debug)]
pub struct Characteristic {
characteristic_type: CharacteristicType,