com.artemis.Aspect.<init>()方法的使用及代码示例

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

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

Aspect.<init>介绍

[英]Access Aspect creation through static factory methods.
[中]通过静态工厂方法访问方面创建。

代码示例

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

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

代码示例来源: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: 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: 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: 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: 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

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

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

相关文章