Pretty self-explanatory, want to remove some objects but the player, healthbar... What is the best way to do this?
List<Actor> actors = getObjects(null);
for (Actor obj : actors)
{
if ((!obj.equals(Healthbar.class)) && (!obj.equals(Player.class)))
{
removeObject(obj);
}
}// in the World subclass in the place you want to do the removing removeObjects(getObjects(FirstClassName.class)); // one type of class to remove removeObjects(getObjects(SecondClassName.class)); // another type of class to remove removeObjects(getObjects(ThirdClassName.class)); // a third type of class to remove
List<Actor> actorsList = getObjects(null); for (Actor actor : actorsList) if (! (actor instanceof Healthbar) && ! (actor instanceof Player)) removeObject(actor);