本文整理汇总了Java中com.artemis.utils.Bag.get方法的典型用法代码示例。如果您正苦于以下问题:Java Bag.get方法的具体用法?Java Bag.get怎么用?Java Bag.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.artemis.utils.Bag
的用法示例。
在下文中一共展示了Bag.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findPoint
import com.artemis.utils.Bag; //导入方法依赖的package包/类
static IntBag findPoint (TestData data, IntBag fill, Bag<TestData> testData) {
for (int i = 0; i < testData.size(); i++) {
TestData test = testData.get(i);
if (test.contains(data.x, data.y)) {
fill.add(test.id);
}
}
fill.clear();
return fill;
}
示例2: find
import com.artemis.utils.Bag; //导入方法依赖的package包/类
static IntBag find (TestData data, IntBag fill, Bag<TestData> testData) {
for (int i = 0; i < testData.size(); i++) {
TestData test = testData.get(i);
if (test.overlaps(data.x, data.y, data.width, data.height)) {
fill.add(test.id);
}
}
fill.clear();
return fill;
}
示例3: getComponent
import com.artemis.utils.Bag; //导入方法依赖的package包/类
protected Component getComponent(Entity e, ComponentType type) {
Bag<Component> components = componentsByType.get(type.getIndex());
if(components != null) {
return components.get(e.getId());
}
return null;
}
示例4: check
import com.artemis.utils.Bag; //导入方法依赖的package包/类
/**
* Performs an action on each entity.
* @param entities
* @param performer
*/
private void check(Bag<Entity> entities, Performer performer) {
if (!entities.isEmpty()) {
for (int i = 0; entities.size() > i; i++) {
Entity e = entities.get(i);
notifyManagers(performer, e);
notifySystems(performer, e);
}
entities.clear();
}
}
示例5: disposeSystems
import com.artemis.utils.Bag; //导入方法依赖的package包/类
private void disposeSystems(World world) {
// Delete entities with Effects
ImmutableBag<Entity> entities = world.getManager(GroupManager.class).getEntities(Constants.EFFECTS);
for (int i = 0; i < entities.size(); ++i) {
Bag<Component> components = new Bag<Component>();
world.getComponentManager().getComponentsFor(entities.get(i), components);
for (int j = 0; j < components.size(); ++j) {
// System.out.print("C: ");
Component c = components.get(j);
// System.out.println(c.getClass());
if (c instanceof Effect) {
// System.out.println("REMOVE");
((Effect) c).dispose();
}
}
}
// Delete systems
ImmutableBag<EntitySystem> entitySystems = world.getSystems();
for (int i = 0; i < entitySystems.size(); ++i) {
EntitySystem e = entitySystems.get(i);
if (e instanceof EffectSystem) {
((EffectSystem) e).dispose();
} else if (e instanceof SpriteRenderSystem) {
((SpriteRenderSystem) e).dispose();
}
}
}