Exemple #1
0
 // Visitor pattern core, Gets the given Moveable type as argument
 // In this case, the given object is a Box
 // If the box is compatible, then isolating and signaling to the game field, to increment score
 public void Visit(Box b)
 {
     if (compatible.Contains(b))
     {
         b.Isolate();
         GameField.GetInstance().Score(b.pushedByColor);
     }
 }
Exemple #2
0
 // Destroys the box by removing it from the field and from the game field
 public override void Destroy()
 {
     underThis.RemoveMoveable();
     GameField.GetInstance().RemoveBox(this);
 }
 // ReMoves the worker from the control interface
 // and signals this action to the game field
 public void RemoveWorker()
 {
     worker = null;
     GameField.GetInstance().OutOfWorkers();
 }