Ejemplo 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());
     }
 }
Ejemplo n.º 2
0
 public void Dispense()
 {
     Console.WriteLine("Dispensing...");
     gumballMachine.ReleaseBall();
     gumballMachine.SetState(gumballMachine.GetNoQuarterState());
 }
Ejemplo n.º 3
0
 public void EjectQuarter()
 {
     Console.WriteLine("Quarter was ejected.");
     GumballMachine.SetState(GumballMachine.GetNoQuarterState());
 }