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

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