コード例 #1
0
        // User selects Potions
        private void PotionOption()
        {
            ObjectMenu <Potion> menu = new ObjectMenu <Potion>(shop.Potions, Status);
            Potion potion            = menu.Run();

            if (potion != null)
            {
                if (potion.Cost <= player.Gold)
                {
                    player.RemoveGold(potion.Cost);
                    player.Inventory.AddItem(potion.Clone());
                }
                else
                {
                    Console.WriteLine(INSUFFCIENT_FUNDS_PROMPT);
                }
            }
            this.Run(); // Run the menu again
        }