private void removeComponents(int entityId) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { mappers.get(i).internalRemove(entityId); } setIdentity(entityId, 0); }
private void removeComponents(int entityId) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { mappers.get(i).internalRemove(entityId); } setIdentity(entityId, 0); }
private void removeComponents(int entityId) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { mappers.get(i).internalRemove(entityId); } setIdentity(entityId, 0); }
/** * Get all component associated with an entity. * * @param entityId * the entity to get components from * @param fillBag * a bag to be filled with components * @return the {@code fillBag}, filled with the entities components */ public Bag<Component> getComponentsFor(int entityId, Bag<Component> fillBag) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { fillBag.add(mappers.get(i).get(entityId)); } return fillBag; }
/** * Get all component associated with an entity. * * @param entityId * the entity to get components from * @param fillBag * a bag to be filled with components * @return the {@code fillBag}, filled with the entities components */ public Bag<Component> getComponentsFor(int entityId, Bag<Component> fillBag) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { fillBag.add(mappers.get(i).get(entityId)); } return fillBag; }
/** * Get all component associated with an entity. * * @param entityId * the entity to get components from * @param fillBag * a bag to be filled with components * @return the {@code fillBag}, filled with the entities components */ public Bag<Component> getComponentsFor(int entityId, Bag<Component> fillBag) { Bag<ComponentMapper> mappers = componentMappers(entityId); for (int i = 0, s = mappers.size(); s > i; i++) { fillBag.add(mappers.get(i).get(entityId)); } return fillBag; }