/** * @param processSitesEvenIfNoListener * If true, only act on fields with an attached {@link LinkListener}. * @param fireEventsOnRegistration * If true, */ public EntityLinkManager(boolean processSitesEvenIfNoListener, boolean fireEventsOnRegistration) { super(all()); this.requireListener = !processSitesEvenIfNoListener; this.fireEventsOnRegistration = fireEventsOnRegistration; }
/** * Creates a new EntityProcessingSystem. */ @SuppressWarnings("unchecked") public ClampedSystem() { super(Aspect.all(Pos.class, Clamped.class)); }
/** * @param processSitesEvenIfNoListener * If true, only act on fields with an attached {@link LinkListener}. * @param fireEventsOnRegistration * If true, */ public EntityLinkManager(boolean processSitesEvenIfNoListener, boolean fireEventsOnRegistration) { super(all()); this.requireListener = !processSitesEvenIfNoListener; this.fireEventsOnRegistration = fireEventsOnRegistration; }
public SubscriptionManager() { super(Aspect.all()); subscriberEntities = new HashMap<>(); entitySubscribers = new Bag<>(); }
/** * Creates an filter where an entity must possess all of the specified component types. * * @param type a required component type * @param types a required component type * @return an filter that can be matched against entities */ public static Aspect getAspectForAll(Class<? extends Component> type, Class<? extends Component>... types) { Aspect filter = new Aspect(); filter.all(type, types); return filter; }
public OptimizedSystemAdditional() { super(Aspect.all()); setEnabled(true); begin(); }
@Override public void setWorld(World world) { all = world.getAspectSubscriptionManager().get(all()); } }
@Override protected void setWorld(World world) { super.setWorld(world); // making sure the first subscription matches all entities get(all()); }
public IntOptimizedSystemAdditional() { super(Aspect.all()); setEnabled(true); begin(); }
@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()); }
public PlayerSystem() { super(Aspect.all(Player.class, Transform.class, Renderer.class, RigidBody.class, State.class)); fromV = new Vector2(); toV = new Vector2(); }
@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()); }
private Aspect.Builder toAspect(All all, One one, Exclude exclude) { return all(all != null ? all.value() : EMPTY_COMPONENT_CLASS_ARRAY) .one(one != null ? one.value() : EMPTY_COMPONENT_CLASS_ARRAY) .exclude(exclude != null ? exclude.value() : EMPTY_COMPONENT_CLASS_ARRAY); }
private Aspect.Builder toAspect(AspectDescriptor ad) { return all(ad.all()).one(ad.one()).exclude(ad.exclude()); }
private Aspect.Builder toAspect(All all, One one, Exclude exclude) { return all(all != null ? all.value() : EMPTY_COMPONENT_CLASS_ARRAY) .one(one != null ? one.value() : EMPTY_COMPONENT_CLASS_ARRAY) .exclude(exclude != null ? exclude.value() : EMPTY_COMPONENT_CLASS_ARRAY); }