Remember, the engine runs about 60 loops a second or more, so a loop in a loop is something you use sparingly, each object is a container, so your enemy is a container, you just need to check for a local event or variable against that object, and only objects that match a condition, its overkill trying to check all in the layout, and from my experience, so far no real need of using foreach yet, all personal opinion of course