com.artemis.Aspect类的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(198)

本文整理了Java中com.artemis.Aspect类的一些代码示例,展示了Aspect类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Aspect类的具体详情如下:
包路径:com.artemis.Aspect
类名称:Aspect

Aspect介绍

[英]DEPRECATED in favor of Aspect, which is much clearer description of what an Aspect is.
[中]不推荐使用Aspect,因为Aspect更清楚地描述了Aspect是什么。

代码示例

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * @param processSitesEvenIfNoListener
  3. * If true, only act on fields with an attached {@link LinkListener}.
  4. * @param fireEventsOnRegistration
  5. * If true,
  6. */
  7. public EntityLinkManager(boolean processSitesEvenIfNoListener, boolean fireEventsOnRegistration) {
  8. super(all());
  9. this.requireListener = !processSitesEvenIfNoListener;
  10. this.fireEventsOnRegistration = fireEventsOnRegistration;
  11. }

代码示例来源:origin: apotapov/gdx-artemis

  1. /**
  2. * Creates an filter where an entity must possess all of the specified component types.
  3. *
  4. * @param type a required component type
  5. * @param types a required component type
  6. * @return an filter that can be matched against entities
  7. */
  8. public static Aspect getAspectForAll(Class<? extends Component> type, Class<? extends Component>... types) {
  9. Aspect filter = new Aspect();
  10. filter.all(type, types);
  11. return filter;
  12. }

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-components-libgdx

  1. public AnimRenderSystem(EntityProcessPrincipal principal) {
  2. super(Aspect.getAspectForAll(Pos.class, Anim.class, Renderable.class).exclude(Invisible.class), principal);
  3. }

代码示例来源:origin: apotapov/gdx-artemis

  1. /**
  2. * Creates an filter where an entity must possess one of the specified component types.
  3. *
  4. * @param type one of the types the entity must possess
  5. * @param types one of the types the entity must possess
  6. * @return an filter that can be matched against entities
  7. */
  8. public static Aspect getAspectForOne(Class<? extends Component> type, Class<? extends Component>... types) {
  9. Aspect filter = new Aspect();
  10. filter.one(type, types);
  11. return filter;
  12. }

代码示例来源:origin: stackoverflow.com

  1. @Bean
  2. @DependsOn({"foo", "bar"})
  3. Aspect aspect() {
  4. return new Aspect();
  5. }

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * Returns whether this Aspect would accept the given Entity.
  3. */
  4. public boolean isInterested(Entity e){
  5. return isInterested(e.getComponentBits());
  6. }

代码示例来源:origin: apotapov/gdx-artemis

  1. /**
  2. * Creates and returns an empty filter. This can be used if you want a system that processes no entities, but
  3. * still gets invoked. Typical usages is when you need to create special purpose systems for debug rendering,
  4. * like rendering FPS, how many entities are active in the world, etc.
  5. *
  6. * You can also use the all, one and exclude methods on this filter, so if you wanted to create a system that
  7. * processes only entities possessing just one of the components A or B or C, then you can do:
  8. * Aspect.getEmpty().one(A,B,C);
  9. *
  10. * @return an empty Aspect that will reject all entities.
  11. */
  12. public static Aspect getEmpty() {
  13. return new Aspect();
  14. }

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * Returns whether this Aspect would accept the given Entity.
  3. */
  4. public boolean isInterested(Entity e){
  5. return isInterested(e.getComponentBits());
  6. }

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-jam

  1. /**
  2. * Creates a new EntityProcessingSystem.
  3. */
  4. @SuppressWarnings("unchecked")
  5. public ClampedSystem() {
  6. super(Aspect.all(Pos.class, Clamped.class));
  7. }

代码示例来源:origin: stackoverflow.com

  1. List<RestrictionTemplates> templates = new ArrayList<RestrictionTemplates>();
  2. for (int crtTplId : passedIds) {
  3. templates.add(entityManager.find(RestrictionTemplates.class, crtTplId));
  4. }
  5. List<Restriction> restrictions = new ArrayList<Restriction>();
  6. for (RestrictionTemplates crtTpl : templates) {
  7. restrictions.add(new Restriction(crtTpl));
  8. }
  9. Aspect aspect = new Aspect();
  10. aspect.restrictions = restrictions;
  11. entityManager.persist(aspect);

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

  1. /**
  2. * Returns whether this Aspect would accept the given Entity.
  3. */
  4. public boolean isInterested(Entity e){
  5. return isInterested(e.getComponentBits());
  6. }

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

  1. /**
  2. * @param processSitesEvenIfNoListener
  3. * If true, only act on fields with an attached {@link LinkListener}.
  4. * @param fireEventsOnRegistration
  5. * If true,
  6. */
  7. public EntityLinkManager(boolean processSitesEvenIfNoListener, boolean fireEventsOnRegistration) {
  8. super(all());
  9. this.requireListener = !processSitesEvenIfNoListener;
  10. this.fireEventsOnRegistration = fireEventsOnRegistration;
  11. }

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * Bake an aspect.
  3. * @param world
  4. * @return Instance of Aspect.
  5. */
  6. public Aspect build(World world) {
  7. ComponentTypeFactory tf = world.getComponentManager().typeFactory;
  8. Aspect aspect = new Aspect();
  9. associate(tf, allTypes, aspect.allSet);
  10. associate(tf, exclusionTypes, aspect.exclusionSet);
  11. associate(tf, oneTypes, aspect.oneSet);
  12. return aspect;
  13. }

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * A new unique component composition detected, check if this
  3. * subscription's aspect is interested in it.
  4. */
  5. void processComponentIdentity(int id, BitVector componentBits) {
  6. aspectCache.ensureCapacity(id);
  7. aspectCache.set(id, extra.aspect.isInterested(componentBits));
  8. }

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

  1. /**
  2. * Creates a new EntityProcessingSystem.
  3. */
  4. @SuppressWarnings("unchecked")
  5. public ClampedSystem() {
  6. super(Aspect.all(Pos.class, Clamped.class));
  7. }

代码示例来源:origin: junkdog/artemis-odb

  1. /**
  2. * Bake an aspect.
  3. * @param world
  4. * @return Instance of Aspect.
  5. */
  6. public Aspect build(World world) {
  7. ComponentTypeFactory tf = world.getComponentManager().typeFactory;
  8. Aspect aspect = new Aspect();
  9. associate(tf, allTypes, aspect.allSet);
  10. associate(tf, exclusionTypes, aspect.exclusionSet);
  11. associate(tf, oneTypes, aspect.oneSet);
  12. return aspect;
  13. }

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

  1. /**
  2. * A new unique component composition detected, check if this
  3. * subscription's aspect is interested in it.
  4. */
  5. void processComponentIdentity(int id, BitVector componentBits) {
  6. aspectCache.ensureCapacity(id);
  7. aspectCache.set(id, extra.aspect.isInterested(componentBits));
  8. }

代码示例来源:origin: yichen0831/Bomberman_libGdx

  1. public RenderSystem(SpriteBatch batch) {
  2. super(Aspect.all(Transform.class, Renderer.class));
  3. this.batch = batch;
  4. }

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

  1. /**
  2. * Bake an aspect.
  3. * @param world
  4. * @return Instance of Aspect.
  5. */
  6. public Aspect build(World world) {
  7. ComponentTypeFactory tf = world.getComponentManager().typeFactory;
  8. Aspect aspect = new Aspect();
  9. associate(tf, allTypes, aspect.allSet);
  10. associate(tf, exclusionTypes, aspect.exclusionSet);
  11. associate(tf, oneTypes, aspect.oneSet);
  12. return aspect;
  13. }

代码示例来源:origin: junkdog/artemis-odb

  1. public ProfiledSystem() {
  2. super(Aspect.all());
  3. }

相关文章