private void decrementLife(CellPosition cause) { if (lifeCount > 0) { lifeCount--; gameEventManager.notifyAll(new GameStatEvent(GameEvent.EventType.LIFE_LOST, cause, -1)); } else { gameEventManager.notifyAll(new GameStatEvent(GameEvent.EventType.LIFE_LOST, cause, -1)); gameEventManager.notifyAll(new GameLifecycleEvent(GameEvent.EventType.GAME_OVER)); } }
public SurvivalLifeUpdater(Activity activity) { super(activity); gameEventManager = GameEventManager.getInstance(); lifeCount = 3; updateText(getLifeAsString()); }