|
@ -82,6 +82,11 @@ pub enum InventoryItemAddToError { |
|
|
ExceedsCapacity,
|
|
|
ExceedsCapacity,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug, Clone)]
|
|
|
|
|
|
#[error("")]
|
|
|
|
|
|
pub enum InventoryAddError {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
impl InventoryItem {
|
|
|
impl InventoryItem {
|
|
|
pub fn entity_ids(&self) -> Vec<ItemEntityId> {
|
|
|
pub fn entity_ids(&self) -> Vec<ItemEntityId> {
|
|
|
match self {
|
|
|
match self {
|
|
@ -511,7 +516,7 @@ impl CharacterInventory { |
|
|
.nth(0)
|
|
|
.nth(0)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub fn add_item(&mut self, item: InventoryItem) -> Result<(), ()> { // TODO: errors
|
|
|
|
|
|
|
|
|
pub fn add_item(&mut self, item: InventoryItem) -> Result<(), InventoryAddError> { // TODO: errors
|
|
|
// TODO: check slot conflict?
|
|
|
// TODO: check slot conflict?
|
|
|
self.items.push(item);
|
|
|
self.items.push(item);
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|