Example #1
0
  public void run() {
    while (true) {
      float timePassed = (System.nanoTime() - lastTimeNanos) / 10000000f;
      lastTimeNanos = System.nanoTime();

      if (!rpgBot.isRunning) return;
      for (Manager m : managers) {
        m.update(timePassed);
      }

      try {
        Thread.sleep(50);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
Example #2
0
 public static Manager getManagerByName(String name) {
   for (Manager m : managers) {
     if (m.getName().equals(name)) return m;
   }
   return null;
 }