本文整理汇总了Java中com.badlogic.ashley.core.ComponentType.getFor方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentType.getFor方法的具体用法?Java ComponentType.getFor怎么用?Java ComponentType.getFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.ashley.core.ComponentType
的用法示例。
在下文中一共展示了ComponentType.getFor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}