/// <summary> /// Main interaction between customer and a soda machine. /// </summary> /// <param name="sodaMachine">The soda machine instance being used.</param> /// <returns>True/False if customer successfully got a soda.</returns> public bool UseSodaMachine(SodaMachine sodaMachine) { UserInterface.DisplayMainScreen(); string sodaChoiceName = UserInterface.SodaSelectionScreen(sodaMachine.sodaSelection); if (!UserInterface.GetUserInputYesNo("ͰGRBL We now accept credit\n cards. Would you like to\nuse your credit card? (Y/N)", 25, 11)) { UserInterface.ClearGrayBox(); return(sodaMachine.Transaction(this, sodaChoiceName, ChoseCoinsToInsert())); } UserInterface.ClearGrayBox(); return(sodaMachine.Transaction(this, sodaChoiceName)); }
/// <summary> /// Create new instance of Simulation with default user stories values /// </summary> /// <param name="userstoriesDefaults">True: Set to user stories defaults</param> public Simulation(bool userstoriesDefaults) { if (userstoriesDefaults) { customer = new Customer(true); // Creates a new SodaMachine with the default user stories values sodaMachine = new SodaMachine(20, 10, 20, 50, 5, 5, 5); } else { customer = new Customer(); sodaMachine = new SodaMachine(); } }
/// <summary> /// Create new isntance of Simulation with Empty Customer and Soda Machine /// </summary> public Simulation() { customer = new Customer(); sodaMachine = new SodaMachine(); }