Example #1
0
        public static void Main()
        {
            var machine = new CoffeeMachine();

            machine.InsertCoins(7);
            machine.ChooseCoffee(1);
            machine.InsertCoins(10);
            machine.InsertCoins(7);
            machine.TakeCoffee();
        }
Example #2
0
 public AwaitingMoneyState(CoffeeMachine machine, int price)
 {
     this.paymentLeft = price;
     this.machine     = machine;
 }
Example #3
0
 public IdleState(CoffeeMachine machine, int moneyInside = 0)
 {
     this.machine     = machine;
     this.moneyInside = moneyInside;
 }
Example #4
0
 public IssuedProductState(CoffeeMachine machine, int change)
 {
     this.machine = machine;
     Console.WriteLine("Given change: {0}.", change);
 }