示例#1
0
        public void BuyItems(Player player)
        {
            string itemName;

            do
            {
                UserInterface.DisplayMoneyAndInventory(player);

                itemName = UserInterface.DecideItemToBuy();
                if (itemName != "nothing")
                {
                    int itemsToBuy = UserInterface.DecideNumberOfItemsToBuy(itemName);
                    int itemsSold  = store.SellItemToPlayer(player, itemsToBuy, itemName);
                    player.AddItemsToInventory(itemsSold, itemName);
                    UserInterface.ReadAndClear();
                }
            } while (itemName != "nothing");
        }