/** * Checks if the entity has been added to the world and has not been * deleted from it. * <p> * If the entity has been disabled this will still return true. * </p> * @return {@code true} if it's active */ public boolean isActive() { return world.getEntityManager().isActive(id); }
/** * Checks if the entity has been added to the world and has not been * deleted from it. * <p> * If the entity has been disabled this will still return true. * </p> * @return {@code true} if it's active */ public boolean isActive() { return world.getEntityManager().isActive(id); }
EntityTransmuter(World world, BitVector additions, BitVector removals) { em = world.getEntityManager(); entityToIdentity = world.getComponentManager().entityToIdentity; batchProcessor = world.batchProcessor; operations = new Bag<TransmuteOperation>(TransmuteOperation.class); factory = new Factory(world, additions, removals); }
/** * Create an entity for the specified world. * @param world World this entity belongs to. */ public Entity(World world) { this.world = world; this.entityManager = world.getEntityManager(); this.componentManager = world.getComponentManager(); systemBits = new Bits(); componentBits = new Bits(); }
EntityTransmuter(World world, BitVector additions, BitVector removals) { em = world.getEntityManager(); entityToIdentity = world.getComponentManager().entityToIdentity; batchProcessor = world.batchProcessor; operations = new Bag<TransmuteOperation>(TransmuteOperation.class); factory = new Factory(world, additions, removals); }
BatchChangeProcessor(World world) { this.world = world; asm = world.getAspectSubscriptionManager(); EntityManager em = world.getEntityManager(); em.registerEntityStore(changed); em.registerEntityStore(deleted); em.registerEntityStore(pendingPurge); }
BatchChangeProcessor(World world) { this.world = world; asm = world.getAspectSubscriptionManager(); EntityManager em = world.getEntityManager(); em.registerEntityStore(changed); em.registerEntityStore(deleted); em.registerEntityStore(pendingPurge); }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }
/** * Synchronizes new subscriptions with {@link World} state. * * @param es entity subscription to update. */ void synchronize(EntitySubscription es) { Bag<BitVector> compositionBits = identityResolver.compositionBits; for (int i = 1, s = compositionBits.size(); s > i; i++) { BitVector componentBits = compositionBits.get(i); es.processComponentIdentity(i, componentBits); } for (Entity e : world.getEntityManager().entities) { if (e != null) es.check(e.id, getIdentity(e.id)); } es.informEntityChanges(); es.rebuildCompressedActives(); }
EntitySubscription(World world, Aspect.Builder builder) { extra = new SubscriptionExtra(builder.build(world), builder); activeEntityIds = new BitVector(); entities = new IntBag(); insertedIds = new BitVector(); removedIds = new BitVector(); EntityManager em = world.getEntityManager(); em.registerEntityStore(activeEntityIds); em.registerEntityStore(insertedIds); em.registerEntityStore(removedIds); }
EntitySubscription(World world, Aspect.Builder builder) { extra = new SubscriptionExtra(builder.build(world), builder); activeEntityIds = new BitVector(); entities = new IntBag(); insertedIds = new BitVector(); removedIds = new BitVector(); EntityManager em = world.getEntityManager(); em.registerEntityStore(activeEntityIds); em.registerEntityStore(insertedIds); em.registerEntityStore(removedIds); }
void initialize(World world, Injector injector, AspectSubscriptionManager asm) { if (invocationStrategy == null) invocationStrategy = new InvocationStrategy(); invocationStrategy.setWorld(world); world.invocationStrategy = invocationStrategy; systems.set(COMPONENT_MANAGER_IDX, world.getComponentManager()); systems.set(ENTITY_MANAGER_IDX, world.getEntityManager()); systems.set(ASPECT_SUBSCRIPTION_MANAGER_IDX, asm); for (BaseSystem system : systems) { world.partition.systems.put(system.getClass(), system); system.setWorld(world); if (ClassReflection.isInstance(Manager.class, system)) { ((Manager) system).registerManager(); } } injector.initialize(world, injectables); initializeSystems(injector); asm.processComponentIdentity(NO_COMPONENTS, new BitVector()); invocationStrategy.setSystems(systems); invocationStrategy.initialize(); }
void initialize(World world, Injector injector, AspectSubscriptionManager asm) { if (invocationStrategy == null) invocationStrategy = new InvocationStrategy(); invocationStrategy.setWorld(world); world.invocationStrategy = invocationStrategy; systems.set(COMPONENT_MANAGER_IDX, world.getComponentManager()); systems.set(ENTITY_MANAGER_IDX, world.getEntityManager()); systems.set(ASPECT_SUBSCRIPTION_MANAGER_IDX, asm); for (BaseSystem system : systems) { world.partition.systems.put(system.getClass(), system); system.setWorld(world); if (ClassReflection.isInstance(Manager.class, system)) { ((Manager) system).registerManager(); } } injector.initialize(world, injectables); initializeSystems(injector); asm.processComponentIdentity(NO_COMPONENTS, new BitVector()); invocationStrategy.setSystems(systems); invocationStrategy.initialize(); }