pub fn convert_inventory_from_database_items(
    inventory_container_id: i64,
    inventory_items: &[Item],
    loadout_container_id: i64,
    loadout_items: &[Item],
    overflow_items_container_id: i64,
    overflow_items: &[Item]
) -> Result<Inventory, PersistenceError>
Expand description

Properly-recursive items (currently modular weapons) occupy the same inventory slot as their parent. The caller is responsible for ensuring that inventory_items and loadout_items are topologically sorted (i.e. forall i, items[i].parent_container_item_id == x implies exists j < i satisfying items[j].item_id == x)