public void processShouts(int delta) { if (gameState.getTime() - timeSinceLastRandomShout >= SHOUT_INTERVAL) { shoutController.addRandomShouts(); timeSinceLastRandomShout = gameState.getTime(); } shoutController.updateShouts(delta); }
public void processNPC(int delta) { if (gameState.getTime() - timeSinceLastNPC >= NPC_INTERVAL) { npcController.addRandomNPC(); timeSinceLastNPC = gameState.getTime(); } npcController.updateNPCs(delta); }
private boolean processCompiler() { if (gameState.getTime() - timeSinceLastCompilerIncrement >= COMPILER_INTERVAL) { compilerController.developFeatures(); timeSinceLastCompilerIncrement = gameState.getTime(); } return true; }
private boolean processMood() { if (gameState.getTime() - timeSinceLastMoodUpdate >= MOOD_INTERVAL) { moodController.updateDevelopersPerformance(); moodController.updateProductionPerformance(); timeSinceLastMoodUpdate = gameState.getTime(); } return true; }
private boolean processSalary() { if (gameState.getTime() - timeSinceLastSalary >= SALARY_INTERVAL) { if (!moneyController.paySalary()) { return false; } timeSinceLastSalary = gameState.getTime(); } // Log.debug("Money = " + gameState.getMoney()); return true; }
private boolean processMaps() { if (gameState.getTime() - timeSinceLastProduction >= PRODUCTION_INTERVAL) { if (!mapController.updateProduction()) { return false; } mapController.updateBugfix(); timeSinceLastProduction = gameState.getTime(); } return true; }
public boolean processTimeEvent(int delta) { gameState.setTime(gameState.getTime() + delta); // Log.debug("Time set to " + gameState.getTime()); boolean res = true; res &= processSalary(); res &= processMood(); res &= processCompiler(); res &= processMaps(); processShouts(delta); processNPC(delta); return res; }