Browse Source

InventoryItem::{stacked, mag}

pull/80/head
jake 3 years ago
parent
commit
296d1cc0ea
  1. 14
      src/ship/items/inventory.rs

14
src/ship/items/inventory.rs

@ -220,6 +220,20 @@ impl InventoryItem {
_ => None _ => 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
}
}
} }

Loading…
Cancel
Save