コード例 #1
0
 public void Visit(MundaneItem item)
 {
     if (item.Name.ToLower() != "nothing")
     {
         lootBag.Add(item);
     }
 }
コード例 #2
0
        /// <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;
            }
        }
コード例 #3
0
        //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);
                }
            }
        }
コード例 #4
0
 public void Visit(MundaneItem item)
 {
 }