Beispiel #1
0
 public void die(Unit unit)
 {
     MoveContainer.getInstance().Remove(unit);
     CollisionContainer.getInstance().Remove(unit);
     DrawContainer.getInstance().Remove(unit);
     UnitContainer.getInstance().Remove(unit);
     unit._currentRound.removeUnit(unit);
 }
Beispiel #2
0
 public void subscribe()   //Singleton anti-pattern :(
 {
     state = UnitStateFactory.Instance.create("unit-alive");
     DrawContainer.getInstance().Add(this);
     MoveContainer.getInstance().Add(this);
     CollisionContainer.getInstance().Add(this);
     UnitContainer.getInstance().Add(this);
     _currentRound.registerUnit(this);
 }
 internal void Visit(TimedTextDisplay timedTextDisplay, double delta)
 {
     timedTextDisplay.eleapsedTime += delta;
     if (timedTextDisplay.eleapsedTime >= timedTextDisplay.maxTime)
     {
         DrawContainer.getInstance().Remove(timedTextDisplay);
         MoveContainer.getInstance().Remove(timedTextDisplay);
     }
 }
 public TextDisplay(int x, int y, String text, Color c, int size)
 {
     this.text  = text;
     this.size  = size;
     this.y     = y;
     this.x     = x;
     this.color = c;
     DrawContainer.getInstance().Add(this);
 }
Beispiel #5
0
 void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     DrawContainer.getInstance().Draw(canvas, delta);
 }