public void creatureDefeated() { foreach (string itemName in this.Inventory.Keys) { ICarryableItem item = this.Inventory[itemName]; TheGame.CurrentArea.AddItem((Item)item, itemName); } }
/// <summary> /// Put the Item in your backpack. /// </summary> /// <param name="item">Item.</param> public void PickUp(ICarryableItem item) { // if you already have some of this item, put it with those. if (_backpack.ContainsKey(item.Name)) { _backpack [item.Name].Add(item); } // otherwise start a new stack else { _backpack.Add(item.Name, new List <ICarryableItem>() { item }); } }