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