/** * 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); } }
@Override public void removed(IntBag entities) { deleted(entities); } });
@Override public void removed(IntBag entities) { deleted(entities); } });
/** * 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); } }
/** * Deleted entities are removed from their player. * * @param e * the deleted entity */ @Override public void deleted(Entity e) { removeFromPlayer(e); } }
public World() { this(new ComponentManager(), new EntityManager()); }
/** * 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; }
/** * Create and return a new or reused entity instance. * Will NOT add the entity to the world, use World.addEntity(Entity) * for that. * * @return created entity */ public Entity createEntity() { return em.createEntityInstance(); }
/** * Get a entity having the specified id. * * @param entityId id of the entity to retrieve. * @return entity Entity or null. */ public Entity getEntity(int entityId) { return em.getEntity(entityId); }
/** * Deleted entities are removed from their player. * * @param e * the deleted entity */ @Override public void deleted(Entity e) { removeFromPlayer(e); } }
@Override public void removed(IntBag entities) { deleted(entities); } });
@Override public void removed(IntBag entities) { deleted(entities); } });
/** * 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); } }
/** * 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); } }
/** * 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); }
/** * Removes the entity from the specified groups. * * @param e entity to remove from group * @param g1 group to remove the entity from * @param g2 group to remove the entity from * @param g3 group to remove the entity from */ public void remove(Entity e, String g1, String g2, String g3) { remove(e, g1); remove(e, g2); remove(e, g3); }