Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public void doAction(Game game)
 {
     InputContainer.getInstance().Add(new ShootInput(game, UnitContainer.getInstance().objects));
 }