Ejemplo n.º 1
0
 public void processShouts(int delta) {
   if (gameState.getTime() - timeSinceLastRandomShout >= SHOUT_INTERVAL) {
     shoutController.addRandomShouts();
     timeSinceLastRandomShout = gameState.getTime();
   }
   shoutController.updateShouts(delta);
 }
Ejemplo n.º 2
0
 public void processNPC(int delta) {
   if (gameState.getTime() - timeSinceLastNPC >= NPC_INTERVAL) {
     npcController.addRandomNPC();
     timeSinceLastNPC = gameState.getTime();
   }
   npcController.updateNPCs(delta);
 }
Ejemplo n.º 3
0
 private boolean processCompiler() {
   if (gameState.getTime() - timeSinceLastCompilerIncrement >= COMPILER_INTERVAL) {
     compilerController.developFeatures();
     timeSinceLastCompilerIncrement = gameState.getTime();
   }
   return true;
 }
Ejemplo n.º 4
0
 private boolean processMood() {
   if (gameState.getTime() - timeSinceLastMoodUpdate >= MOOD_INTERVAL) {
     moodController.updateDevelopersPerformance();
     moodController.updateProductionPerformance();
     timeSinceLastMoodUpdate = gameState.getTime();
   }
   return true;
 }
Ejemplo n.º 5
0
 private boolean processSalary() {
   if (gameState.getTime() - timeSinceLastSalary >= SALARY_INTERVAL) {
     if (!moneyController.paySalary()) {
       return false;
     }
     timeSinceLastSalary = gameState.getTime();
   }
   // Log.debug("Money = " + gameState.getMoney());
   return true;
 }
Ejemplo n.º 6
0
 private boolean processMaps() {
   if (gameState.getTime() - timeSinceLastProduction >= PRODUCTION_INTERVAL) {
     if (!mapController.updateProduction()) {
       return false;
     }
     mapController.updateBugfix();
     timeSinceLastProduction = gameState.getTime();
   }
   return true;
 }
Ejemplo n.º 7
0
  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;
  }