Пример #1
0
        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();
        }
Пример #2
0
 public SoldState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }
Пример #3
0
 public SoldOutState(GumballMachine gumballMachine)
 {
     _gumballMachine = gumballMachine;
 }
Пример #4
0
 public WinnerState(GumballMachine gumballMachine)
 {
     Machine = gumballMachine;
 }
Пример #5
0
 public NoQuarterState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }
Пример #6
0
 public HasQuarterState(GumballMachine gumballMachine)
 {
     this._gumballMachine = gumballMachine;
 }
Пример #7
0
 public NoQuarterState(GumballMachine machine)
 {
     Machine = machine;
 }
Пример #8
0
 public NoOneRMBState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }