public override void Dispense() { gummballDispenser.ReleaseBall(); if (gummballDispenser.Count > 0) { gummballDispenser.SetState(gummballDispenser.NoQuarterState); } else { Console.WriteLine("Oops, out of gumballs!"); gummballDispenser.SetState(gummballDispenser.SoldOutState); } }
public override void InsertQuarter() { Console.WriteLine("You inserted a quarter"); gummballDispenser.SetState(gummballDispenser.HasQuarterState); }
public override void EjectQuarter() { Console.WriteLine("Quarter returned"); gummballDispenser.SetState(gummballDispenser.NoQuarterState); }