Beispiel #1
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
 }
Beispiel #2
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;
   }
 }
Beispiel #3
0
 public void addEvent(Event e) {
   events.add(e);
   Quest.updateConditions();
 }