@Override public void render(GameContainer gc, Graphics g) { for (ILevelEntity e : mLevelEntities) { e.render(gc, g); } }
public List<Intersection> getIntersectionsWith(LineSegment ls) { List<Intersection> intersections = new ArrayList<Intersection>(); for (ILevelEntity e : mLevelEntities) { for (Intersection i : e.getIntersectionsWith(ls)) { if (i != null) intersections.add(i); } } return intersections; }
@Override public void update(GameContainer gc, double timeElapsed) { for (ILevelEntity e : mEntitiesToRemove) { mLevelEntities.remove(e); } for (ILevelEntity e : mEntitiesToAdd) { mLevelEntities.add(e); } mEntitiesToAdd.clear(); System.out.println("Entities: " + mLevelEntities.size()); for (ILevelEntity e : mLevelEntities) { e.update(gc, timeElapsed); } }