本文整理了Java中com.artemis.utils.Bag.getCapacity()
方法的一些代码示例,展示了Bag.getCapacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bag.getCapacity()
方法的具体详情如下:
包路径:com.artemis.utils.Bag
类名称:Bag
方法名:getCapacity
[英]Returns the number of elements the bag can hold without growing.
[中]
代码示例来源:origin: junkdog/artemis-odb
/**
* Checks if the internal storage supports this index.
*
* @param index
* index to check
*
* @return {@code true} if the index is within bounds
*/
public boolean isIndexWithinBounds(int index) {
return index < getCapacity();
}
代码示例来源:origin: junkdog/artemis-odb
/**
* Checks if the internal storage supports this index.
*
* @param index
* index to check
*
* @return {@code true} if the index is within bounds
*/
public boolean isIndexWithinBounds(int index) {
return index < getCapacity();
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
/**
* Checks if the internal storage supports this index.
*
* @param index
* index to check
*
* @return {@code true} if the index is within bounds
*/
public boolean isIndexWithinBounds(int index) {
return index < getCapacity();
}
代码示例来源:origin: junkdog/artemis-odb
public void registerEntityStore(BitVector bv) {
bv.ensureCapacity(entities.getCapacity());
entityBitVectors.add(bv);
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
public void registerEntityStore(BitVector bv) {
bv.ensureCapacity(entities.getCapacity());
entityBitVectors.add(bv);
}
代码示例来源:origin: junkdog/artemis-odb
/**
* Instantiates an Entity without registering it into the world.
* @param id The ID to be set on the Entity
*/
private Entity createEntity(int id) {
Entity e = new Entity(world, id);
if (e.id >= entities.getCapacity()) {
growEntityStores();
}
// can't use unsafe set, as we need to track highest id
// for faster iteration when syncing up new subscriptions
// in ComponentManager#synchronize
entities.set(e.id, e);
return e;
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
/**
* Instantiates an Entity without registering it into the world.
* @param id The ID to be set on the Entity
*/
private Entity createEntity(int id) {
Entity e = new Entity(world, id);
if (e.id >= entities.getCapacity()) {
growEntityStores();
}
// can't use unsafe set, as we need to track highest id
// for faster iteration when syncing up new subscriptions
// in ComponentManager#synchronize
entities.set(e.id, e);
return e;
}
代码示例来源:origin: junkdog/artemis-odb
private void growEntityStores() {
int newSize = 2 * entities.getCapacity();
entities.ensureCapacity(newSize);
ComponentManager cm = world.getComponentManager();
cm.ensureCapacity(newSize);
for (int i = 0, s = entityBitVectors.size(); s > i; i++) {
entityBitVectors.get(i).ensureCapacity(newSize);
}
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
private void growEntityStores() {
int newSize = 2 * entities.getCapacity();
entities.ensureCapacity(newSize);
ComponentManager cm = world.getComponentManager();
cm.ensureCapacity(newSize);
for (int i = 0, s = entityBitVectors.size(); s > i; i++) {
entityBitVectors.get(i).ensureCapacity(newSize);
}
}
内容来源于网络,如有侵权,请联系作者删除!