Esempio n. 1
0
  /** Adds the {@link EntitySystem} to this Engine. */
  public void addSystem(EntitySystem system) {
    Class<? extends EntitySystem> systemType = system.getClass();

    if (!systemsByClass.containsKey(systemType)) {
      systems.add(system);
      systemsByClass.put(systemType, system);
      system.addedToEngine(this);

      systems.sort(comparator);
    }
  }
Esempio n. 2
0
 /** Removes the {@link EntitySystem} from this Engine. */
 public void removeSystem(EntitySystem system) {
   if (systems.removeValue(system, true)) {
     systemsByClass.remove(system.getClass());
     system.removedFromEngine(this);
   }
 }