Exemplo n.º 1
0
        public void CheckOutAtRegister(Player player)
        {
            player.wallet.DecrementMoney(totalCostOfPurchase);
            player.inventory.IncrementInventory(item, amountToPurchase);

            UI.DisplayTotalMoney(player.wallet);
            UI.DisplayInventoryContents(player.inventory);
        }
Exemplo n.º 2
0
        public void RunGame()
        {
            SetDaysToPlay();
            //GenerateListOfDays();

            while (dayCount <= daysToPlay)
            {
                UI.DisplayGameMenu();
                int userInput = Int32.Parse(Console.ReadLine());

                switch (userInput)
                {
                case 1:
                    //UI.DisplayWeeklyForecast(listOfDays);
                    //UI.DisplayWeather(day.weather.actualCondition, day.weather.forecastTemperature);
                    // display weekly forecast
                    break;

                case 2:
                    UI.DisplayInventoryContents(player.inventory);
                    break;

                case 3:
                    UI.DisplayTotalMoney(player.wallet);
                    break;

                case 4:
                    store.isShopping = true;
                    store.VisitStore(player);
                    break;

                case 5:
                    day.isRunning = true;
                    day.RunDay(player, store, day);
                    //dayIsRunning = true;
                    //GenerateBuyingCustomers();
                    // foreach(Day day in listOfDay){day.runDay}
                    // day.RunDay(day[i]);
                    // dayCount ++
                    break;

                case 6:
                    dayCount = daysToPlay + 1;
                    break;

                default:
                    RunGame();
                    break;
                }
            }
            // End of game
        }
Exemplo n.º 3
0
        public void VisitStore(Player player)
        {
            while (isShopping)
            {
                UI.DisplayStoreMenu();
                int userInput = Convert.ToInt32(Console.ReadLine());

                switch (userInput)
                {
                case 1:
                    item = new Lemon();
                    StartCheckOut(player);
                    break;

                case 2:
                    item = new CupOfSugar();
                    StartCheckOut(player);
                    break;

                case 3:
                    item = new IceCube();
                    StartCheckOut(player);
                    break;

                case 4:
                    item = new Cup();
                    StartCheckOut(player);
                    break;

                case 5:
                    UI.DisplayInventoryContents(player.inventory);
                    break;

                case 6:
                    UI.DisplayTotalMoney(player.wallet);
                    break;

                case 7:
                    isShopping = false;
                    break;

                default:
                    break;
                }
            }
        }