using System.Collections.Generic;
namespace Cyber.Items {
///
/// Represents the equipped items at given slots.
///
public class Equipped {
Dictionary EquippedItems = new Dictionary();
///
/// Inserts an item here, marking it as 'equipped'.
///
/// The slot to equip the item to.
/// The item to equip.
public void SetSlot(EquipSlot slot, Item item) {
EquippedItems[slot] = item;
}
///
/// Empties the desired slot of any items.
///
/// The slot to empty.
public void ClearSlot(EquipSlot slot) {
EquippedItems.Remove(slot);
}
///
/// Returns the item at the given slot, or null if no item at the slot was found.
///
///
///
public Item GetItem(EquipSlot slot) {
if (EquippedItems.ContainsKey(slot)) {
return EquippedItems[slot];
}
return null;
}
///
/// Returns a dictionary of all equipped items.
///
/// Dictionary of equipped items.
public Dictionary GetEquippedDict() {
return EquippedItems;
}
///
/// Returns a list of all items that are generally equipped.
///
/// List of equipped items.
public List- GetEquippedList() {
return new List
- (EquippedItems.Values);
}
///
/// Clears all equipped items, removing them from their slots.
///
public void ClearAllEquipped() {
EquippedItems.Clear();
}
}
}