public void Visit(MundaneItem item) { if (item.Name.ToLower() != "nothing") { lootBag.Add(item); } }
/// <summary> /// process the effects of using the treasure /// </summary> /// <param name="treasure">treasure</param> private void ProcessMundaneItemUse(MundaneItem mundaneItem) { string message; switch (mundaneItem.UseAction) { case MundaneItem.UseActionType.OPENLOCATION: message = _gameMap.OpenLocationsByMundaneItem(mundaneItem.Id); CurrentLocationInformation = mundaneItem.UseMessage; break; case MundaneItem.UseActionType.KILLPLAYER: OnPlayerDies(mundaneItem.UseMessage); break; default: break; } }
//update the game item list public void UpdateInventoryCategories() { Potions.Clear(); MundaneItem.Clear(); Keys.Clear(); foreach (var gameItemQuantity in _inventory) { if (gameItemQuantity.GameItem is Potion) { Potions.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is MundaneItem) { MundaneItem.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is Key) { Keys.Add(gameItemQuantity); } } }
public void Visit(MundaneItem item) { }