本文整理了Java中com.artemis.utils.Bag.<init>()
方法的一些代码示例,展示了Bag.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bag.<init>()
方法的具体详情如下:
包路径:com.artemis.utils.Bag
类名称:Bag
方法名:<init>
[英]Constructs an empty Bag with an initial capacity of 64.
[中]构造一个初始容量为64的空包。
代码示例来源:origin: junkdog/artemis-odb
private Builder() {
allTypes = new Bag<Class<? extends Component>>();
exclusionTypes = new Bag<Class<? extends Component>>();
oneTypes = new Bag<Class<? extends Component>>();
}
代码示例来源:origin: junkdog/artemis-odb
private Builder() {
allTypes = new Bag<Class<? extends Component>>();
exclusionTypes = new Bag<Class<? extends Component>>();
oneTypes = new Bag<Class<? extends Component>>();
}
代码示例来源:origin: junkdog/artemis-odb
/**
* Reset builder
*/
private void reset() {
invocationStrategy = null;
systems = new Bag<>();
fieldResolvers = new Bag<>();
plugins = new Bag<>();
alwaysDelayComponentRemoval = false;
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
private Builder() {
allTypes = new Bag<Class<? extends Component>>();
exclusionTypes = new Bag<Class<? extends Component>>();
oneTypes = new Bag<Class<? extends Component>>();
}
代码示例来源:origin: junkdog/artemis-odb
public UuidEntityManager() {
this.uuidToEntity = new HashMap<UUID, Entity>();
this.entityToUuid = new Bag<UUID>();
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
/**
* Creates a new EntityManager Instance.
*/
protected EntityManager(int initialContainerSize) {
entities = new Bag<Entity>(initialContainerSize);
registerEntityStore(recycled);
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
/**
* Constructs an archetype builder containing the composition of the specified parent.
*
* @param parent archetype composition to copy.
*/
public ArchetypeBuilder(Archetype parent) {
classes = new Bag<Class<? extends Component>>();
if (parent == null)
return;
parent.transmuter.getAdditions(classes);
}
代码示例来源:origin: junkdog/artemis-odb
/**
* Constructs an archetype builder containing the composition of the specified parent.
*
* @param parent archetype composition to copy.
*/
public ArchetypeBuilder(Archetype parent) {
classes = new Bag<Class<? extends Component>>();
if (parent == null)
return;
parent.transmuter.getAdditions(classes);
}
代码示例来源:origin: junkdog/artemis-odb
ComponentIdentityResolver() {
compositionBits = new Bag(BitVector.class);
compositionBits.add(new BitVector());
compositionMappers = new Bag<Bag<ComponentMapper>>();
compositionMappers.add(new Bag(ComponentMapper.class));
}
代码示例来源:origin: junkdog/artemis-odb
/**
* Creates a new EntityManager Instance.
*/
protected EntityManager(int initialContainerSize) {
entities = new Bag<Entity>(initialContainerSize);
registerEntityStore(recycled);
}
代码示例来源:origin: junkdog/artemis-odb
ComponentIdentityResolver() {
compositionBits = new Bag(BitVector.class);
compositionBits.add(new BitVector());
compositionMappers = new Bag<Bag<ComponentMapper>>();
compositionMappers.add(new Bag(ComponentMapper.class));
}
代码示例来源:origin: junkdog/artemis-odb
@Override
public Bag read(Json json, JsonValue jsonData, Class type) {
Bag<Entity> result = new Bag<Entity>();
for (JsonValue child = jsonData.child; child != null; child = child.next)
result.add(json.readValue(Entity.class, child));
return result;
}
}
代码示例来源:origin: junkdog/artemis-odb
@Override
public Bag read(Json json, JsonValue jsonData, Class type) {
Bag<Entity> result = new Bag<Entity>();
for (JsonValue child = jsonData.child; child != null; child = child.next)
result.add(json.readValue(Entity.class, child));
return result;
}
}
代码示例来源:origin: junkdog/artemis-odb
EntityTransmuter(World world, BitVector additions, BitVector removals) {
em = world.getEntityManager();
entityToIdentity = world.getComponentManager().entityToIdentity;
batchProcessor = world.batchProcessor;
operations = new Bag<TransmuteOperation>(TransmuteOperation.class);
factory = new Factory(world, additions, removals);
}
代码示例来源:origin: junkdog/artemis-odb
@Override
public ArchetypeMapper.TransmuterEntry read(Json json, JsonValue jsonData, Class type) {
Bag components = new Bag();
for (JsonValue child = jsonData.child; child != null; child = child.next)
components.add(identifiers.getType(json.readValue(String.class, child)));
return new ArchetypeMapper.TransmuterEntry(components);
}
}
代码示例来源:origin: junkdog/artemis-odb
private Bag<ComponentMapper> getAdditions(BitVector origin) {
ComponentTypeFactory tf = cm.typeFactory;
Bag<ComponentMapper> types = new Bag(ComponentMapper.class);
for (int i = additions.nextSetBit(0); i >= 0; i = additions.nextSetBit(i + 1)) {
if (!origin.get(i))
types.add(cm.getMapper(tf.getTypeFor(i).getType()));
}
return types;
}
代码示例来源:origin: junkdog/artemis-odb
private Bag<ComponentMapper> getRemovals(BitVector origin) {
ComponentTypeFactory tf = cm.typeFactory;
Bag<ComponentMapper> types = new Bag(ComponentMapper.class);
for (int i = removals.nextSetBit(0); i >= 0; i = removals.nextSetBit(i + 1)) {
if (origin.get(i))
types.add(cm.getMapper(tf.getTypeFor(i).getType()));
}
return types;
}
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
private Bag<ComponentMapper> getAdditions(BitVector origin) {
ComponentTypeFactory tf = cm.typeFactory;
Bag<ComponentMapper> types = new Bag(ComponentMapper.class);
for (int i = additions.nextSetBit(0); i >= 0; i = additions.nextSetBit(i + 1)) {
if (!origin.get(i))
types.add(cm.getMapper(tf.getTypeFor(i).getType()));
}
return types;
}
代码示例来源:origin: junkdog/artemis-odb
int allocateIdentity(BitVector componentBits, ComponentManager cm) {
Bag<ComponentMapper> mappers =
new Bag<ComponentMapper>(ComponentMapper.class, componentBits.cardinality());
ComponentTypeFactory tf = cm.getTypeFactory();
for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i + 1)) {
mappers.add(cm.getMapper(tf.getTypeFor(i).getType()));
}
compositionMappers.add(mappers);
compositionBits.add(new BitVector(componentBits));
return compositionBits.size() - 1;
}
}
代码示例来源:origin: net.onedaybeard.artemis/artemis-odb
int allocateIdentity(BitVector componentBits, ComponentManager cm) {
Bag<ComponentMapper> mappers =
new Bag<ComponentMapper>(ComponentMapper.class, componentBits.cardinality());
ComponentTypeFactory tf = cm.getTypeFactory();
for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i + 1)) {
mappers.add(cm.getMapper(tf.getTypeFor(i).getType()));
}
compositionMappers.add(mappers);
compositionBits.add(new BitVector(componentBits));
return compositionBits.size() - 1;
}
}
内容来源于网络,如有侵权,请联系作者删除!