public WinnerState(GumballMachine machine) { _machine = machine; }
public GumballMonitor(GumballMachine machine) { _machine = machine; }
static void Main(string[] args) { string location = "Seattle"; int count = 122; GumballMachine gumballMachine = new GumballMachine(location, count); GumballMonitor monitor = new GumballMonitor(gumballMachine); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); gumballMachine.InsertQuarter(); gumballMachine.TurnCrank(); Console.WriteLine(gumballMachine); monitor.Report(); // Wait for user Console.ReadKey(); }
public WinnerState(GumballMachine machine) { this._machine = machine; }
public SoldState(GumballMachine machine) { this._machine = machine; }
public NoQuarterState(GumballMachine machine) { this._machine = machine; }
public GumballMonitor(GumballMachine machine) { this._machine = machine; }