/** * @return entity subscription backing this system. */ public EntitySubscription getSubscription() { final AspectSubscriptionManager sm = world.getAspectSubscriptionManager(); return sm.get(aspectConfiguration); }
/** * @return entity subscription backing this system. */ public EntitySubscription getSubscription() { final AspectSubscriptionManager sm = world.getAspectSubscriptionManager(); return sm.get(aspectConfiguration); }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); } }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); } }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); } }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); } }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); }
/** * Get all entities matching aspect. * For performance reasons do not create the aspect every call. * @return {@code EBag} of entities matching aspect. Returns empty bag if no entities match aspect. */ public static EBag withAspect(Aspect.Builder aspect) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag(_processingMapper.getWorld().getAspectSubscriptionManager().get(aspect).getEntities()); }
@Override protected void initialize() { world.getAspectSubscriptionManager().get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) { } @Override public void removed(IntBag entities) { deleted(entities); } }); }
@Override protected void initialize() { world.getAspectSubscriptionManager() .get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) {} @Override public void removed(IntBag entities) { deleted(entities); } }); }
/** * Fetches unique identifier for composition. * * @param componentBits composition to fetch unique identifier for. * @return Unique identifier for passed composition. */ public int compositionIdentity(BitVector componentBits) { int identity = identityResolver.getIdentity(componentBits); if (identity == -1) { identity = identityResolver.allocateIdentity(componentBits, this); world.getAspectSubscriptionManager() .processComponentIdentity(identity, componentBits); } return identity; }
/** * Get all entities with component. * This is a relatively costly operation. For performance use withAspect instead. * @return {@code EBag} of entities matching aspect. Returns empty bag if no entities match aspect. */ public static EBag withComponent(Class<? extends Component> component) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag(_processingMapper.getWorld().getAspectSubscriptionManager().get(Aspect.all(component)).getEntities()); }
/** Hack to register manager to right subscription */ protected void registerManager() { world.getAspectSubscriptionManager() .get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) { added(entities); } @Override public void removed(IntBag entities) { deleted(entities); } }); }
/** * Get all entities matching aspect. * For performance reasons do not create the aspect every call. * @return {@code EBag} of entities matching aspect. Returns empty bag if no entities match aspect. */ public static EBag withAspect(Aspect.Builder aspect) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag(_processingMapper.getWorld().getAspectSubscriptionManager().get(aspect).getEntities()); }
@Override protected void initialize() { world.getAspectSubscriptionManager() .get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) {} @Override public void removed(IntBag entities) { deleted(entities); } }); }
/** * Get all entities with component. * This is a relatively costly operation. For performance use withAspect instead. * @return {@code EBag} of entities matching aspect. Returns empty bag if no entities match aspect. */ public static EBag withComponent(Class<? extends Component> component) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag(_processingMapper.getWorld().getAspectSubscriptionManager().get(Aspect.all(component)).getEntities()); }
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); }
protected LinkSite(World world, ComponentType type, Field field, LinkPolicy.Policy defaultPolicy) { this.type = type; this.field = field; LinkPolicy.Policy policyOverride = LinkFactory.getPolicy(field); this.policy = (policyOverride != null) ? policyOverride : defaultPolicy; mapper = world.getMapper(type.getType()); activeEntityIds = world.getAspectSubscriptionManager().get(all()).getActiveEntityIds(); AspectSubscriptionManager subscriptions = world.getAspectSubscriptionManager(); subscription = subscriptions.get(all(type.getType())); subscription.addSubscriptionListener(this); }