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