Removes derive-getters, as it was incredibly annoying in IDEs, and couldn't figure out borrow lifetimes.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user