public void AddItem(EquipItem i) { if (EquipmentList.ContainsKey(i.Slot)) { throw new Exception("Item in dictionary. Possibly remove what's in their first"); } else { EquipmentList.Add(i.Slot, i); i.OnEquip(Owner, i); throw new Exception("Remove from player bag"); } }
public void Remove(EquipItem.EquipSlot slot) { if (!EquipmentList.ContainsKey(slot)) { throw new Exception("No item in that slot"); } else { EquipItem itemToRemove; EquipmentList.TryGetValue(slot, out itemToRemove); EquipmentList.Remove(slot); //OWNER.INVENTORY.ADD ITEMTOREMOVE throw new NotImplementedException("Add item to players inventory"); } }
public EquipmentObj(string deviceType) { addItems(); this.DeviceType = EquipmentList.ContainsKey(device_Type) ? EquipmentList[deviceType] : "Default"; }