/** * Get target entity of entity edits. * * @return Entity this EntityEdit operates on. */ public Entity getEntity() { return cm.world.getEntity(entityId); }
@Override public void write(int value, Component c, Field f) { Entity e = (value != -1) ? world.getEntity(value) : null; ((UniEntityLink) c).field = e; }
@Override public void write(int value, Component c, Field f) { Entity e = (value != -1) ? world.getEntity(value) : null; ((UniEntityLink) c).field = e; }
@Override public void write(int value, Component c, Field f) { try { Entity e = (value != -1) ? world.getEntity(value) : null; f.set(c, e); } catch (ReflectionException exc) { throw new RuntimeException(exc); } }
Entity createEntity() { return world.getEntity(pool.getData()[poolIndex++]); } }
@Override public void write(int value, Component c, Field f) { try { Entity e = (value != -1) ? world.getEntity(value) : null; f.set(c, e); } catch (ReflectionException exc) { throw new RuntimeException(exc); } }
public void add(final int entityId, String... groups) { final Entity e = world.getEntity(entityId); add(e, groups); }
@Override protected final void removed(int entityId) { removed(world.getEntity(entityId)); }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; if (registered.get(id)) { String removedTag = tagsByEntity.remove(world.getEntity(id)); entitiesByTag.remove(removedTag); registered.clear(id); } } }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { int id = ids[i]; if (registered.get(id)) { String removedTag = tagsByEntity.remove(world.getEntity(id)); entitiesByTag.remove(removedTag); registered.clear(id); } } }
private void deleted(IntBag entities) { // performance hack, skip if manager lacks implementation of removed. if ((methodFlags & FLAG_REMOVED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { deleted(world.getEntity(ids[i])); } }
public E removeGroups() { World w = mappers.getWorld(); w.getSystem(com.artemis.managers.GroupManager.class).removeFromAllGroups(w.getEntity(entityId)); return this; }
public E group(String group) { World w = mappers.getWorld(); w.getSystem(com.artemis.managers.GroupManager.class).add(w.getEntity(entityId), group); return this; }
public E removeGroup(String group) { World w = mappers.getWorld(); w.getSystem(com.artemis.managers.GroupManager.class).remove(w.getEntity(entityId), group); return this; }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { removeFromAllGroups(world.getEntity(ids[i])); } } }
private void added(IntBag entities) { // performance hack, skip if manager lacks implementation of inserted. if ((methodFlags & FLAG_INSERTED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { added(world.getEntity(ids[i])); } }
private void deleted(IntBag entities) { // performance hack, skip if manager lacks implementation of removed. if ((methodFlags & FLAG_REMOVED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { deleted(world.getEntity(ids[i])); } }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { removeFromAllGroups(world.getEntity(ids[i])); } } }
private void added(IntBag entities) { // performance hack, skip if manager lacks implementation of inserted. if ((methodFlags & FLAG_INSERTED) == 0) return; int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { added(world.getEntity(ids[i])); } }
public ImmutableBag<String> groups() { World w = mappers.getWorld(); return w.getSystem(com.artemis.managers.GroupManager.class).getGroups(w.getEntity(entityId)); }