using System.Collections.Generic;
namespace IgniteEngine.Content.Items
{
///
/// Class that holds a collection of item instances.
///
public class Inventory
{
///
/// The items inside of the inventory.
///
public List- Items { get; set; }
///
/// The inventory's type.
///
public InventoryType Type { get; set; }
///
/// The maximum number of items this inventory can store.
///
private int capacity;
///
/// Creates a new instance of the class.
///
/// The type of the inventory.
/// The maximum number of items the inventory can contain.
public Inventory(InventoryType type, int capacity)
{
Items = new List
- (capacity);
Type = type;
this.capacity = capacity;
}
///
/// Returns the item at the specified inventory position.
///
/// The item's position.
public Item this[byte slot] => Items.First(i => i.Slot == slot);
}
}