split player module

This commit is contained in:
2019-10-19 21:44:10 +02:00
parent 24807615f7
commit 2248e25aec
4 changed files with 121 additions and 110 deletions

View File

@@ -124,6 +124,14 @@ impl<'q> LootManager<'q> {
.first(self.0)?)
}
pub(crate) fn add<S: Into<String>>(self, name: S, base_price: i32) -> QueryResult<Item> {
self.add_from(&Item {
id: 0,
name: name.into(),
base_price,
})
}
/// Adds a copy of the given item inside player chest
pub fn add_from(self, item: &Item) -> QueryResult<Item> {
let new_item = NewLoot {