コード例 #1
0
 public void processShouts(int delta) {
   if (gameState.getTime() - timeSinceLastRandomShout >= SHOUT_INTERVAL) {
     shoutController.addRandomShouts();
     timeSinceLastRandomShout = gameState.getTime();
   }
   shoutController.updateShouts(delta);
 }
コード例 #2
0
 public void processNPC(int delta) {
   if (gameState.getTime() - timeSinceLastNPC >= NPC_INTERVAL) {
     npcController.addRandomNPC();
     timeSinceLastNPC = gameState.getTime();
   }
   npcController.updateNPCs(delta);
 }
コード例 #3
0
 private boolean processCompiler() {
   if (gameState.getTime() - timeSinceLastCompilerIncrement >= COMPILER_INTERVAL) {
     compilerController.developFeatures();
     timeSinceLastCompilerIncrement = gameState.getTime();
   }
   return true;
 }
コード例 #4
0
 private boolean processMood() {
   if (gameState.getTime() - timeSinceLastMoodUpdate >= MOOD_INTERVAL) {
     moodController.updateDevelopersPerformance();
     moodController.updateProductionPerformance();
     timeSinceLastMoodUpdate = gameState.getTime();
   }
   return true;
 }
コード例 #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;
 }
コード例 #6
0
 private boolean processMaps() {
   if (gameState.getTime() - timeSinceLastProduction >= PRODUCTION_INTERVAL) {
     if (!mapController.updateProduction()) {
       return false;
     }
     mapController.updateBugfix();
     timeSinceLastProduction = gameState.getTime();
   }
   return true;
 }
コード例 #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;
  }