Esempio n. 1
0
 private void updateTime() {
   timeLeap = 0;
   for (Event e : events.getAddBuffer()) {
     if (e.getSpeed() != 0) timeLeap += 100 / e.getSpeed();
   }
   time += timeLeap;
   if (time >= DAY_LENGTH) {
     day++;
     time -= DAY_LENGTH;
   }
 }
Esempio n. 2
0
 public void newTurn() {
   turn++;
   updateTime();
   currentMap.update(timeLeap);
   if (previousMapTimer > 0) {
     previousMap.update(timeLeap);
     previousMapTimer -= timeLeap;
   }
   player.update();
   for (Event e : events.getAddBuffer()) {
     addMessage(e.getMessage());
   }
   events.update(); // TODO: optimize double looping
 }