/** * Set the group of the entity. * * @param groups groups to add the entity into * @param e entity to add into the group */ public void add(Entity e, String... groups) { for (String group : groups) { add(e, group); } }
/** * Checks if the entity belongs to any group. * * @param e the entity to check * @return true. if it is in any group, false if none */ public boolean isInAnyGroup(Entity e) { return getGroups(e).size() > 0; }
public boolean isInGroup(final int entityId, String group) { final Entity e = world.getEntity(entityId); return isInGroup(e, group); }
/** * Removes the entity from the specified groups * * @param e entity to remove from group * @param groups groups to remove the entity from */ public void remove(Entity e, String... groups) { for (String group : groups) { remove(e, group); } }
public void removeFromAllGroups(final int entityId) { final Entity e = world.getEntity(entityId); removeFromAllGroups(e); }
/** * Get entities in group.. * @return {@code EBag} of entities in group. Returns empty bag if group contains no entities. */ public static EBag withGroup(String groupName) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag((com.artemis.utils.IntBag)_processingMapper.getWorld().getSystem(com.artemis.managers.GroupManager.class).getEntityIds(groupName)); }
/** * Removes the entity from the specified groups * * @param e entity to remove from group * @param groups groups to remove the entity from */ public void remove(Entity e, String... groups) { for (String group : groups) { remove(e, group); } }
public void removeFromAllGroups(final int entityId) { final Entity e = world.getEntity(entityId); removeFromAllGroups(e); }
/** * Get entities in group.. * @return {@code EBag} of entities in group. Returns empty bag if group contains no entities. */ public static EBag withGroup(String groupName) { if(_processingMapper==null) throw new RuntimeException("SuperMapper system must be registered before any systems using E().");; return new EBag((com.artemis.utils.IntBag)_processingMapper.getWorld().getSystem(com.artemis.managers.GroupManager.class).getEntityIds(groupName)); }
public ImmutableBag<String> getGroups(final int entityId) { final Entity e = world.getEntity(entityId); return getGroups(e); }
public E removeGroups() { World w = mappers.getWorld(); w.getSystem(com.artemis.managers.GroupManager.class).removeFromAllGroups(w.getEntity(entityId)); return this; }
public boolean isInGroup(final int entityId, String group) { final Entity e = world.getEntity(entityId); return isInGroup(e, group); }
/** * Set the group of the entity. * * @param g1 group to add the entity into * @param g2 group to add the entity into * @param g3 group to add the entity into * @param e entity to add into the group */ public void add(Entity e, String g1, String g2, String g3) { add(e, g1); add(e, g2); add(e, g3); }
/** * Checks if the entity belongs to any group. * * @param e the entity to check * @return true. if it is in any group, false if none */ public boolean isInAnyGroup(Entity e) { return getGroups(e).size() > 0; }
void deleted(IntBag entities) { int[] ids = entities.getData(); for (int i = 0, s = entities.size(); s > i; i++) { removeFromAllGroups(world.getEntity(ids[i])); } } }
public boolean isInGroup(String group) { World w = mappers.getWorld(); return w.getSystem(com.artemis.managers.GroupManager.class).isInGroup(w.getEntity(entityId), group); }