static void Main(string[] args) { GumballMachine gumballMachine = new GumballMachine(5); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); Console.ReadKey(); }
public NoQuarterState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }
public WinnerState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }
public SoldState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }