/** * Gets the entities processed by this system. Do not delete entities from * this bag - it is the live thing. * * @return System's entity ids, as matched by aspect. */ public IntBag getEntityIds() { return subscription.getEntities(); }
/** * Gets the entities processed by this system. Do not delete entities from * this bag - it is the live thing. * * @return System's entity ids, as matched by aspect. */ public IntBag getEntityIds() { return subscription.getEntities(); }
public SaveFileFormat(EntitySubscription es) { this(es.getEntities()); }
public SaveFileFormat(EntitySubscription es) { this(es.getEntities()); }
/** @inheritDoc */ @Override protected final void processSystem() { IntBag actives = subscription.getEntities(); int[] ids = actives.getData(); for (int i = 0, s = actives.size(); s > i; i++) { process(ids[i]); } } }
/** * 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 final void processSystem() { final IntBag activesA = subscriptionA.getEntities(); final IntBag activesB = subscriptionB.getEntities(); final int[] arrayA = activesA.getData(); final int[] arrayB = activesB.getData(); for (int ia = 0, sa = activesA.size(); sa > ia; ia++) { for (int ib = 0, sb = activesB.size(); sb > ib; ib++) { process(arrayA[ia], arrayB[ib]); } } } }
@Override protected final void processSystem() { final IntBag activesA = subscriptionA.getEntities(); final IntBag activesB = subscriptionB.getEntities(); final int[] arrayA = activesA.getData(); final int[] arrayB = activesB.getData(); for (int ia = 0, sa = activesA.size(); sa > ia; ia++) { for (int ib = 0, sb = activesB.size(); sb > ib; ib++) { process(arrayA[ia], arrayB[ib]); } } } }
/** * 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 processSystem() { IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { process(ids[i]); } } }
protected void process() { if (CHECK_SOURCE_AND_TARGETS != policy) return; IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { check(ids[i]); } } }
/** @inheritDoc */ @Override protected final void processSystem() { IntBag actives = subscription.getEntities(); int[] ids = actives.getData(); for (int i = 0, s = actives.size(); s > i; i++) { process(ids[i]); } } }
protected void process() { if (CHECK_SOURCE_AND_TARGETS != policy) return; IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { check(ids[i]); } } }
@Override protected void processSystem() { IntBag entities = subscription.getEntities(); int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { process(ids[i]); } } }
/** * 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()); }
/** * 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()); }
@Override protected void processSystem() { final IntBag entities = subscription.getEntities(); final int processedPerSecond = (int) ((entities.size() / getRoundTripTime())); // Depending on subscription size invocation could potentially require less than // one invocation. Keep track of 'partial' invocations until we can invoke. entitiesToProcess += processedPerSecond * getWorldDelta(); if (entitiesToProcess >= 1f) { processEntities((int) entitiesToProcess, entities.getData(), entities.size()); // keep remainder. entitiesToProcess -= (int) entitiesToProcess; } }
@Override protected void processSystem() { final IntBag entities = subscription.getEntities(); final int processedPerSecond = (int) ((entities.size() / getRoundTripTime())); // Depending on subscription size invocation could potentially require less than // one invocation. Keep track of 'partial' invocations until we can invoke. entitiesToProcess += processedPerSecond * getWorldDelta(); if (entitiesToProcess >= 1f) { processEntities((int) entitiesToProcess, entities.getData(), entities.size()); // keep remainder. entitiesToProcess -= (int) entitiesToProcess; } }
@Override protected final void processSystem() { IntBag entities = subscription.getEntities(); int processed = entities.size(); if (processed == 0) { stop(); return; } delay = Float.MAX_VALUE; int[] ids = entities.getData(); for (int i = 0; processed > i; i++) { int e = ids[i]; processDelta(e, acc); float remaining = getRemainingDelay(e); if(remaining <= 0) { processExpired(e); } else { offerDelay(remaining); } } acc = 0; }
@Override protected final void processSystem() { IntBag entities = subscription.getEntities(); int processed = entities.size(); if (processed == 0) { stop(); return; } delay = Float.MAX_VALUE; int[] ids = entities.getData(); for (int i = 0; processed > i; i++) { int e = ids[i]; processDelta(e, acc); float remaining = getRemainingDelay(e); if(remaining <= 0) { processExpired(e); } else { offerDelay(remaining); } } acc = 0; }