use of de.gurkenlabs.litiengine.entities.IEntity in project litiengine by gurkenlabs.
the class Environment method getByTag.
@Override
public <T extends IEntity> Collection<T> getByTag(Class<T> clss, String rawTag) {
List<T> foundEntities = new ArrayList<>();
final String tag = rawTag.toLowerCase();
if (!this.entitiesByTag.containsKey(tag.toLowerCase())) {
return foundEntities;
}
for (IEntity ent : this.entitiesByTag.get(tag)) {
if (clss.isInstance(ent)) {
foundEntities.add((T) ent);
}
}
return foundEntities;
}
Aggregations