Пример #1
0
 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;
 }
Пример #3
0
 public WinnerState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }
Пример #4
0
 public SoldState(GumballMachine gumballMachine)
 {
     this.gumballMachine = gumballMachine;
 }