/** 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); } }
/** Removes the {@link EntitySystem} from this Engine. */ public void removeSystem(EntitySystem system) { if (systems.removeValue(system, true)) { systemsByClass.remove(system.getClass()); system.removedFromEngine(this); } }