public static void Main() { var machine = new CoffeeMachine(); machine.InsertCoins(7); machine.ChooseCoffee(1); machine.InsertCoins(10); machine.InsertCoins(7); machine.TakeCoffee(); }
public AwaitingMoneyState(CoffeeMachine machine, int price) { this.paymentLeft = price; this.machine = machine; }
public IdleState(CoffeeMachine machine, int moneyInside = 0) { this.machine = machine; this.moneyInside = moneyInside; }
public IssuedProductState(CoffeeMachine machine, int change) { this.machine = machine; Console.WriteLine("Given change: {0}.", change); }