upgrade system

This commit is contained in:
Jim 2025-08-31 23:59:50 -04:00
parent 921947c131
commit 83256bfbe5
Signed by: jim
GPG key ID: 3D7D94BA53088BF4
15 changed files with 331 additions and 43 deletions

View file

@ -58,6 +58,29 @@ pub struct Quantity {
pub bones: u32,
}
impl Quantity {
pub fn to_string(&self) -> String {
let souls_text = if self.souls > 0 {
format!("{} souls", self.souls)
} else {
"".to_string()
};
let divider_text = if self.souls > 0 && self.bones > 0 {
", "
} else if self.souls == 0 && self.bones == 0 {
"FREE!!!"
} else {
""
};
let bones_text = if self.bones > 0 {
format!("{} bones", self.bones)
} else {
"".to_string()
};
format!("{}{}{}", souls_text, divider_text, bones_text)
}
}
impl std::ops::Mul<u32> for Quantity {
type Output = Quantity;