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

@@ -1,8 +1,7 @@
use super::item_category::{BattleItemCategory, ItemCategory};
use derive_getters::Getters;
use std::collections::HashSet;
#[derive(Getters, Debug)]
#[derive(Debug)]
pub struct Item {
name: String,
category: ItemCategory,
@@ -28,6 +27,22 @@ impl Item {
}
}
pub fn name(&self) -> &str {
&self.name
}
pub fn category(&self) -> ItemCategory {
self.category
}
pub fn battle_category(&self) -> BattleItemCategory {
self.battle_category
}
pub fn price(&self) -> i32 {
self.price
}
pub fn flags(&self) -> &HashSet<String> {
&self.flags
}
pub fn has_flag(&self, key: &str) -> bool {
self.flags.contains(key)
}