public void UseItem(Item item) { if (item is Weapon) { equippedItems.Equip(item); } }
public void UnEquipItem() { //Character bob = CreateCharacter(); //Bag b = CreateBag3(); //Dictionary<InventorySlotId, Item> _items = new Dictionary<InventorySlotId, Item>(); //bob.Bag. var equipped = new EquippedItems(); Armor junk = new Armor( Guid.NewGuid(), "Leather Scraps", null, false, .5f, InventorySlotId.UNEQUIPPABLE, 1, 1); Assert.IsNull(equipped[InventorySlotId.HELMET]); equipped.Equip(InventorySlotId.HELMET, junk); Assert.AreEqual(junk, equipped[InventorySlotId.HELMET]); equipped.Unequip(InventorySlotId.HELMET); Assert.AreEqual(null, equipped[InventorySlotId.HELMET]); }
public void EquipFromBackpack(IWearable i) { EquippedItems.Equip(i, Backpack); }