com.artemis.utils.Bag.ensureCapacity()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(103)

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

Bag.ensureCapacity介绍

[英]Check if an item, if added at the given item will fit into the bag.

If not, the bag capacity will be increased to hold an item at the index.

yeah, sorry, it's weird, but we don't want to change existing change behavior
[中]

代码示例

代码示例来源:origin: junkdog/artemis-odb

public void ensureCapacity(int newSize) {
  typeFactory.initialMapperCapacity = newSize;
  entityToIdentity.ensureCapacity(newSize);
  for (ComponentMapper mapper : mappers) {
    mapper.components.ensureCapacity(newSize);
  }
}

代码示例来源:origin: junkdog/artemis-odb

public void ensureCapacity(int newSize) {
  typeFactory.initialMapperCapacity = newSize;
  entityToIdentity.ensureCapacity(newSize);
  for (ComponentMapper mapper : mappers) {
    mapper.components.ensureCapacity(newSize);
  }
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

public void ensureCapacity(int newSize) {
  typeFactory.initialMapperCapacity = newSize;
  entityToIdentity.ensureCapacity(newSize);
  for (ComponentMapper mapper : mappers) {
    mapper.components.ensureCapacity(newSize);
  }
}

代码示例来源:origin: junkdog/artemis-odb

void registerComponentType(ComponentType ct, int capacity) {
  int index = ct.getIndex();
  ComponentMapper mapper = new ComponentMapper(ct.getType(), world);
  mapper.components.ensureCapacity(capacity);
  mappers.set(index, mapper);
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb

void registerComponentType(ComponentType ct, int capacity) {
  int index = ct.getIndex();
  ComponentMapper mapper = new ComponentMapper(ct.getType(), world);
  mapper.components.ensureCapacity(capacity);
  mappers.set(index, mapper);
}

代码示例来源:origin: DaanVanYperen/artemis-odb-contrib

/** Fetch mapper, or create if missing. */
@SuppressWarnings("unchecked")
private <T extends Component> M<T> getCreateMapper(ComponentType type) {
  final int index = type.getIndex();
  mappers.ensureCapacity(index);
  M m = mappers.get(index);
  if (m == null) {
    m = setMapper(index, type.getType());
  }
  return m;
}

代码示例来源:origin: junkdog/artemis-odb

void registerComponentType(ComponentType ct, int capacity) {
  int index = ct.getIndex();
  ComponentMapper mapper = new ComponentMapper(ct.getType(), world);
  mapper.components.ensureCapacity(capacity);
  mappers.set(index, mapper);
}

代码示例来源:origin: net.mostlyoriginal.artemis-odb/contrib-core

/** Fetch mapper, or create if missing. */
@SuppressWarnings("unchecked")
private <T extends Component> M<T> getCreateMapper(ComponentType type) {
  final int index = type.getIndex();
  mappers.ensureCapacity(index);
  M m = mappers.get(index);
  if (m == null) {
    m = setMapper(index, type.getType());
  }
  return m;
}

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

相关文章