Ejemplo n.º 1
0
        public bool HaveEnoughSuppliesToSell()//check and make sure they have enough stuff to sell lemonade
        {
            recipee = new Recipee();

            if (papercupsonhand > 0 && lemonsonhand >= recipee.LemonsUsedForRecipe & cupsofsugaronhand >= recipee.CupsOfSugarUsedForRecipe && iceonhand >= recipee.IceUsedForRecipe)
            {
                return(true);
            }
            Console.WriteLine("You don't have enough stock to sell");//change to an if else and else cww sold out
            return(false);
        }
Ejemplo n.º 2
0
 public int LemonsOnHandAfterMadeRecipe(Recipee recipee, Inventory inventory, Player player)
 {
     try
     {
         removeLemons = player.inventory.lemonsonhand -= recipee.lemonsUsedForRecipe;
         return(removeLemons);
     }
     catch (Exception)
     {
         Console.WriteLine("You do not have that amount in your inventory, try again! \n");
         recipee.LemonsUsedPerPitcher(inventory, player);
         throw;
     }
 }
Ejemplo n.º 3
0
 public int IceCubesOnHandAfterMadeRecipe(Recipee recipee, Inventory inventory, Player player)
 {
     try
     {
         removeIceCubes = player.inventory.iceonhand -= recipee.iceUsedForRecipe;
         return(removeIceCubes);
     }
     catch (Exception)
     {
         Console.WriteLine("You do not have that amount in your inventory, try again! \n");
         recipee.IceCubesPerCup(inventory, player);
         throw;
     }
 }
Ejemplo n.º 4
0
 public int CupsOfSugarAfterMadeRecipe(Recipee recipee, Inventory inventory, Player player)
 {
     try
     {
         removeCupsOfSugar = player.inventory.cupsofsugaronhand -= recipee.CupsOfSugarUsedForRecipe;
         return(removeCupsOfSugar);
     }
     catch (Exception)
     {
         Console.WriteLine("You do not have that amount in your inventory, try again! \n");
         recipee.CupsOfSugarPerPitcher(inventory, player);
         throw;
     }
 }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {   //call all the classes
            Game      game      = new Game();
            Random    rnd       = new Random();
            Day       day       = new Day(rnd);
            Customer  customer  = new Customer();
            Store     store     = new Store();
            Inventory inventory = new Inventory();
            Player    player    = new Player();
            Weather   weather   = new Weather(rnd);
            Recipee   recipee   = new Recipee();

            store.RunGame(inventory, player, store, weather, day, recipee, customer); //run ALL the methods
            //game.StartGame()
        }
Ejemplo n.º 6
0
        public void PurchaseMoreToRestockInventory(Store store, Player player, Recipee recipee, Inventory inventory)
        {
            Console.WriteLine("What would you like to purchase? [L] for Lemons, [S] for Sugar, [I] for Ice, [C] for Cups. \n hit [P] to show the prices, hit [D] when you are done shopping. \n\n");

            string purchase = Console.ReadLine().ToLower();//user can put in upper or lower and it'll auto lower it

            switch (purchase)
            {
            case "l":
                BuyLemons(store, player, inventory);     // all of the buy methods are at the bottom
                break;

            case "s":
                BuySugar(store, player, inventory);
                break;

            case "i":
                BuyIce(store, player, inventory);
                break;

            case "c":
                BuyPaperCups(store, player, inventory);
                break;

            case "p":
                differentStuffToBuy.ForEach(Console.WriteLine);    //display list
                PurchaseMoreToRestockInventory(store, player, recipee, inventory);
                break;

            case "d":
                recipee.IceCubesPerCup(inventory, player);
                break;

            default:
                Console.WriteLine("\n Nope lets try that again! Try [L] for Lemons, [S] for Sugar, [I] for Ice, [C] for Cups. \n hit [P] to show the prices, hit [D] when you are done shopping.\n\n");
                PurchaseMoreToRestockInventory(store, player, recipee, inventory);
                break;
            }
        }
Ejemplo n.º 7
0
 //contructor (build this)
 public Inventory()
 {
     recipee = new Recipee();
 }
Ejemplo n.º 8
0
        };                                                                                                                                                                           //create list of products in the store



        //member method (can do)
        public void RunGame(Inventory inventory, Player player, Store store, Weather weather, Day day, Recipee recipee, Customer customer)
        {
            day.DisplayTheDay();                            //this is day 1 but it still display all days FIX
            weather.WeatherPicker();                        //forecast for today
            Console.WriteLine("Welcome to Deja's Market you can buy: ");
            differentStuffToBuy.ForEach(Console.WriteLine); //display list
            Console.WriteLine("You have $" + player.Wallet + "\n");
            //day.DisplayTheDay(); //delete all these and below later. this is for testing day method to make sure itll show the correct day
            //day.DisplayTheDay();
            //day.DisplayTheDay();
            //day.DisplayTheDay();
            //day.DisplayTheDay();
            //day.DisplayTheDay();
            //day.DisplayTheDay();
            PurchaseMoreToRestockInventory(store, player, recipee, inventory); //welcome to store
            recipee.CupsOfSugarPerPitcher(inventory, player);
            recipee.LemonsUsedPerPitcher(inventory, player);
            recipee.PricePerCupToSell();    //player set the price per cup
            recipee.ShowRecipePlayerMade(); //shows recipe
            weather.ActualWeather();        //then shows the real weather
            //then the next method to sell the lemonade
            Console.ReadLine();             //delete dont think i need this line
        }
Ejemplo n.º 9
0
 public void CalculateIceUsed(Day day, Player player, Recipee recipee)
 {
     iceCubesUsedToday          = totalCupsSold * recipee.iceUsedForRecipe;
     player.inventory.iceonhand = player.inventory.iceonhand - recipee.iceUsedForRecipe;
 }
Ejemplo n.º 10
0
 public void CalculateLemonsUsed(Day day, Player player, Recipee recipee)
 {
     lemonsUsedToday = totalCupsSold * recipee.lemonsUsedForRecipe;
     player.inventory.lemonsonhand = player.inventory.lemonsonhand - recipee.lemonsUsedForRecipe;
 }
Ejemplo n.º 11
0
 public void CalculateSugarUsed(Day day, Player player, Recipee recipee) //Minus from inventory
 {
     cupsOfSugarUsedToday = totalCupsSold * recipee.CupsOfSugarUsedForRecipe;
     player.inventory.cupsofsugaronhand = player.inventory.cupsofsugaronhand - recipee.CupsOfSugarUsedForRecipe;
 }
Ejemplo n.º 12
0
 //constructor (build this)
 public Player()
 {
     inventory = new Inventory();
     recipee   = new Recipee();
 }