static void Main(string[] args) { var gumballMachine = new GumballMachine(5); Console.WriteLine("-------------------"); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine("-------------------"); gumballMachine.InsertQuarter(); gumballMachine.EjectQuarter(); gumballMachine.TurnCrank(); Console.WriteLine("-------------------"); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.EjectQuarter(); Console.WriteLine("-------------------"); gumballMachine.InsertQuarter(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine("-------------------"); Console.ReadLine(); }
public SoldState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }
public SoldOutState(GumballMachine gumballMachine) { _gumballMachine = gumballMachine; }
public WinnerState(GumballMachine gumballMachine) { Machine = gumballMachine; }
public NoQuarterState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }
public HasQuarterState(GumballMachine gumballMachine) { this._gumballMachine = gumballMachine; }
public NoQuarterState(GumballMachine machine) { Machine = machine; }
public NoOneRMBState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; }