/** * @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 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 AnimRenderSystem(EntityProcessPrincipal principal) { super(Aspect.getAspectForAll(Pos.class, Anim.class, Renderable.class).exclude(Invisible.class), principal); }
/** * Creates an filter where an entity must possess one of the specified component types. * * @param type one of the types the entity must possess * @param types one of the types the entity must possess * @return an filter that can be matched against entities */ public static Aspect getAspectForOne(Class<? extends Component> type, Class<? extends Component>... types) { Aspect filter = new Aspect(); filter.one(type, types); return filter; }
@Bean @DependsOn({"foo", "bar"}) Aspect aspect() { return new Aspect(); }
/** * Returns whether this Aspect would accept the given Entity. */ public boolean isInterested(Entity e){ return isInterested(e.getComponentBits()); }
/** * Creates and returns an empty filter. This can be used if you want a system that processes no entities, but * still gets invoked. Typical usages is when you need to create special purpose systems for debug rendering, * like rendering FPS, how many entities are active in the world, etc. * * You can also use the all, one and exclude methods on this filter, so if you wanted to create a system that * processes only entities possessing just one of the components A or B or C, then you can do: * Aspect.getEmpty().one(A,B,C); * * @return an empty Aspect that will reject all entities. */ public static Aspect getEmpty() { return new Aspect(); }
/** * Returns whether this Aspect would accept the given Entity. */ public boolean isInterested(Entity e){ return isInterested(e.getComponentBits()); }
/** * Creates a new EntityProcessingSystem. */ @SuppressWarnings("unchecked") public ClampedSystem() { super(Aspect.all(Pos.class, Clamped.class)); }
List<RestrictionTemplates> templates = new ArrayList<RestrictionTemplates>(); for (int crtTplId : passedIds) { templates.add(entityManager.find(RestrictionTemplates.class, crtTplId)); } List<Restriction> restrictions = new ArrayList<Restriction>(); for (RestrictionTemplates crtTpl : templates) { restrictions.add(new Restriction(crtTpl)); } Aspect aspect = new Aspect(); aspect.restrictions = restrictions; entityManager.persist(aspect);
/** * Returns whether this Aspect would accept the given Entity. */ public boolean isInterested(Entity e){ return isInterested(e.getComponentBits()); }
/** * @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; }
/** * Bake an aspect. * @param world * @return Instance of Aspect. */ public Aspect build(World world) { ComponentTypeFactory tf = world.getComponentManager().typeFactory; Aspect aspect = new Aspect(); associate(tf, allTypes, aspect.allSet); associate(tf, exclusionTypes, aspect.exclusionSet); associate(tf, oneTypes, aspect.oneSet); return aspect; }
/** * A new unique component composition detected, check if this * subscription's aspect is interested in it. */ void processComponentIdentity(int id, BitVector componentBits) { aspectCache.ensureCapacity(id); aspectCache.set(id, extra.aspect.isInterested(componentBits)); }
/** * Creates a new EntityProcessingSystem. */ @SuppressWarnings("unchecked") public ClampedSystem() { super(Aspect.all(Pos.class, Clamped.class)); }
/** * Bake an aspect. * @param world * @return Instance of Aspect. */ public Aspect build(World world) { ComponentTypeFactory tf = world.getComponentManager().typeFactory; Aspect aspect = new Aspect(); associate(tf, allTypes, aspect.allSet); associate(tf, exclusionTypes, aspect.exclusionSet); associate(tf, oneTypes, aspect.oneSet); return aspect; }
/** * A new unique component composition detected, check if this * subscription's aspect is interested in it. */ void processComponentIdentity(int id, BitVector componentBits) { aspectCache.ensureCapacity(id); aspectCache.set(id, extra.aspect.isInterested(componentBits)); }
public RenderSystem(SpriteBatch batch) { super(Aspect.all(Transform.class, Renderer.class)); this.batch = batch; }
/** * Bake an aspect. * @param world * @return Instance of Aspect. */ public Aspect build(World world) { ComponentTypeFactory tf = world.getComponentManager().typeFactory; Aspect aspect = new Aspect(); associate(tf, allTypes, aspect.allSet); associate(tf, exclusionTypes, aspect.exclusionSet); associate(tf, oneTypes, aspect.oneSet); return aspect; }
public ProfiledSystem() { super(Aspect.all()); }