Exemplo n.º 1
0
 public void Dispense()
 {
     gumballMachine.ReleaseBall();
     if (gumballMachine.GetCount() > 0)
     {
         gumballMachine.SetState(gumballMachine.GetNoQuarterState());
     }
     else
     {
         Console.WriteLine("Oops, out of gumballs!");
         gumballMachine.SetState(gumballMachine.GetSoldOutState());
     }
 }
Exemplo n.º 2
0
 public void Refill()
 {
     gumballMachine.SetState(gumballMachine.GetNoQuarterState());
 }