/** @param index the index of the bit to set * @throws ArrayIndexOutOfBoundsException if index < 0 or index >= words.length */ public void unsafeSet(int index, boolean value) { if (value) { unsafeSet(index); } else { unsafeClear(index); } }
/** * Create and return a new or reused entity id. Entity is * automatically added to the world. * * @return assigned entity id, where id >= 0. */ public int create() { int entityId = em.create(); batchProcessor.changed.unsafeSet(entityId); return entityId; }
/** @param index the index of the bit to set * @throws ArrayIndexOutOfBoundsException if index < 0 or index >= words.length */ public void unsafeSet(int index, boolean value) { if (value) { unsafeSet(index); } else { unsafeClear(index); } }
private void free(int entityId) { limbo.add(entityId); recycled.unsafeSet(entityId); } }
private void remove(int entityId) { activeEntityIds.unsafeClear(entityId); removedIds.unsafeSet(entityId); }
private void free(int entityId) { limbo.add(entityId); recycled.unsafeSet(entityId); } }
/** * Create and return a new or reused entity id. Entity is * automatically added to the world. * * @return assigned entity id, where id >= 0. */ public int create() { int entityId = em.create(); batchProcessor.changed.unsafeSet(entityId); return entityId; }
private void remove(int entityId) { activeEntityIds.unsafeClear(entityId); removedIds.unsafeSet(entityId); }
private boolean isValid(int entityId) { if (!em.isActive(entityId)) throw new RuntimeException("Issued transmute on deleted " + entityId); if (batchProcessor.isDeleted(entityId)) return false; batchProcessor.changed.unsafeSet(entityId); return true; }
private boolean isValid(int entityId) { if (!em.isActive(entityId)) throw new RuntimeException("Issued transmute on deleted " + entityId); if (batchProcessor.isDeleted(entityId)) return false; batchProcessor.changed.unsafeSet(entityId); return true; }
/** * Create and return a new or reused entity instance. Entity is * automatically added to the world. * * @return entity * @see #create() recommended alternative. */ public Entity createEntity() { Entity e = em.createEntityInstance(); batchProcessor.changed.unsafeSet(e.getId()); return e; }
/** * Create and return a new or reused entity instance. Entity is * automatically added to the world. * * @return entity * @see #create() recommended alternative. */ public Entity createEntity() { Entity e = em.createEntityInstance(); batchProcessor.changed.unsafeSet(e.getId()); return e; }
private void deletedAll(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; activeEntityIds.unsafeClear(id); removedIds.unsafeSet(id); } }
private void deletedAll(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; activeEntityIds.unsafeClear(id); removedIds.unsafeSet(id); } }
/** * Create and return an {@link Entity} wrapping a new or reused entity instance. * Entity is automatically added to the world. * * Use {@link Entity#edit()} to set up your newly created entity. * * You can also create entities using: * - {@link com.artemis.utils.EntityBuilder} Convenient entity creation. Not useful when pooling. * - {@link com.artemis.Archetype} Fastest, low level, no parameterized components. * * @return assigned entity id */ public int create(Archetype archetype) { int entityId = em.create(); archetype.transmuter.perform(entityId); cm.setIdentity(entityId, archetype.compositionId); batchProcessor.changed.unsafeSet(entityId); return entityId; }
/** * Create and return an {@link Entity} wrapping a new or reused entity instance. * Entity is automatically added to the world. * * Use {@link Entity#edit()} to set up your newly created entity. * * You can also create entities using: * <ul> * <li>{@link com.artemis.utils.EntityBuilder} Convenient entity creation. Not useful when pooling.</li> * <li>{@link com.artemis.Archetype} Fastest, low level, no parameterized components.</li> * <li><a href="https://github.com/junkdog/artemis-odb/wiki/Serialization">Serialization</a>, * with a simple prefab-like class to parameterize the entities.</li> * </ul> * * @see #create() recommended alternative. * @return entity */ public Entity createEntity(Archetype archetype) { Entity e = em.createEntityInstance(); int id = e.getId(); archetype.transmuter.perform(id); cm.setIdentity(e.id, archetype.compositionId); batchProcessor.changed.unsafeSet(id); return e; }