本文整理汇总了Java中com.badlogic.ashley.core.ComponentType类的典型用法代码示例。如果您正苦于以下问题:Java ComponentType类的具体用法?Java ComponentType怎么用?Java ComponentType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComponentType类属于com.badlogic.ashley.core包,在下文中一共展示了ComponentType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sameComponentType
import com.badlogic.ashley.core.ComponentType; //导入依赖的package包/类
@Test
public void sameComponentType () {
ComponentType componentType1 = ComponentType.getFor(ComponentA.class);
ComponentType componentType2 = ComponentType.getFor(ComponentA.class);
assertEquals(true, componentType1.equals(componentType2));
assertEquals(true, componentType2.equals(componentType1));
assertEquals(componentType1.getIndex(), componentType2.getIndex());
assertEquals(componentType1.getIndex(), ComponentType.getIndexFor(ComponentA.class));
assertEquals(componentType2.getIndex(), ComponentType.getIndexFor(ComponentA.class));
}
示例2: differentComponentType
import com.badlogic.ashley.core.ComponentType; //导入依赖的package包/类
@Test
public void differentComponentType () {
ComponentType componentType1 = ComponentType.getFor(ComponentA.class);
ComponentType componentType2 = ComponentType.getFor(ComponentB.class);
assertEquals(false, componentType1.equals(componentType2));
assertEquals(false, componentType2.equals(componentType1));
assertNotEquals(componentType1.getIndex(), componentType2.getIndex());
assertNotEquals(componentType1.getIndex(), ComponentType.getIndexFor(ComponentB.class));
assertNotEquals(componentType2.getIndex(), ComponentType.getIndexFor(ComponentA.class));
}
示例3: validComponentType
import com.badlogic.ashley.core.ComponentType; //导入依赖的package包/类
@Test
public void validComponentType () {
assertNotNull(ComponentType.getFor(ComponentA.class));
assertNotNull(ComponentType.getFor(ComponentB.class));
}
示例4: updateEntities
import com.badlogic.ashley.core.ComponentType; //导入依赖的package包/类
public void updateEntities(Engine engine) {
entities = engine.getEntitiesFor(Family.getFor(ComponentType.getBitsFor(),
ComponentType.getBitsFor(CPhysics.class, CParticle.class), ComponentType.getBitsFor()));
}