attribute exercising
This commit is contained in:
parent
4d614daad5
commit
c757466df1
3 changed files with 33 additions and 2 deletions
|
|
@ -354,6 +354,17 @@ impl Attributes {
|
|||
charisma: Attribute::new(cha),
|
||||
}
|
||||
}
|
||||
pub fn attr_from_index(&self, attr: i32) -> &Attribute {
|
||||
match attr {
|
||||
Self::STR => &self.strength,
|
||||
Self::DEX => &self.dexterity,
|
||||
Self::CON => &self.constitution,
|
||||
Self::INT => &self.intelligence,
|
||||
Self::WIS => &self.wisdom,
|
||||
Self::CHA => &self.charisma,
|
||||
_ => unreachable!("Tried to get an attribute that doesn't exist."),
|
||||
}
|
||||
}
|
||||
pub fn exercise(&mut self, attr: i32, improve: bool) {
|
||||
match attr {
|
||||
Self::STR => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue