Ejemplo n.º 1
0
 public GumBallMachine()
 {
     NoQuarterStateObj  = new NoQuarterState(this);
     HasQuarterStateObj = new HasQuarterState(this);
     SoldStateObj       = new SoldState(this);
     SoldOutStateObj    = new SoldOutState(this);
     state = SoldOutStateObj;
 }
Ejemplo n.º 2
0
 public void Refill(int n)
 {
     GumBallsCount = n;
     state         = NoQuarterStateObj;
 }
Ejemplo n.º 3
0
 public void SetState(IGumBallMachineState newState) => state = newState;