diff --git a/src/ship/items/inventory.rs b/src/ship/items/inventory.rs index 9589849..50d161d 100644 --- a/src/ship/items/inventory.rs +++ b/src/ship/items/inventory.rs @@ -220,6 +220,20 @@ impl InventoryItem { _ => None } } + + pub fn stacked(&self) -> Option<&StackedInventoryItem> { + match self { + InventoryItem::Stacked(ref stacked_inventory_item) => Some(stacked_inventory_item), + _ => None + } + } + + pub fn mag(&self) -> Option<&Mag> { + match self { + InventoryItem::Individual(individual_inventory_item) => individual_inventory_item.mag(), + _ => None + } + } }