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();
        }
Exemple #2
0
 public SoldState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }
 public SoldOutState(GumballMachine gumballMachine)
 {
     _gumballMachine = gumballMachine;
 }
Exemple #4
0
 public WinnerState(GumballMachine gumballMachine)
 {
     Machine = gumballMachine;
 }
 public NoQuarterState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }
Exemple #6
0
 public HasQuarterState(GumballMachine gumballMachine)
 {
     this._gumballMachine = gumballMachine;
 }
 public NoQuarterState(GumballMachine machine)
 {
     Machine = machine;
 }
 public NoOneRMBState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }