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

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

本文整理了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

/**
 * @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;
}

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

/**
 * 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;
}

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

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

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

/**
 * 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;
}

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

@Bean
@DependsOn({"foo", "bar"})
Aspect aspect() {
  return new Aspect();
}

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

/**
 * Returns whether this Aspect would accept the given Entity.
 */
public boolean isInterested(Entity e){
  return isInterested(e.getComponentBits());
}

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

/**
 * 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();
}

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

/**
 * Returns whether this Aspect would accept the given Entity.
 */
public boolean isInterested(Entity e){
  return isInterested(e.getComponentBits());
}

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

/**
 * Creates a new EntityProcessingSystem.
 */
@SuppressWarnings("unchecked")
public ClampedSystem() {
  super(Aspect.all(Pos.class, Clamped.class));
}

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

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);

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

/**
 * Returns whether this Aspect would accept the given Entity.
 */
public boolean isInterested(Entity e){
  return isInterested(e.getComponentBits());
}

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

/**
 * @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;
}

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

/**
 * 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;
}

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

/**
 * 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));
}

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

/**
 * Creates a new EntityProcessingSystem.
 */
@SuppressWarnings("unchecked")
public ClampedSystem() {
  super(Aspect.all(Pos.class, Clamped.class));
}

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

/**
 * 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;
}

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

/**
 * 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));
}

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

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

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

/**
 * 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;
}

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

public ProfiledSystem() {
  super(Aspect.all());
}

相关文章