AnyLogic 6 Discussion

I have a polyline set up, and my agent walks over it. It represents tough terrain. I loop through each agent, checking to see if he is inside the terrain: for (Illegal illegal:illegals) { if (mountains.contains(illegal.getX(),illegal.getY()) == true) { illegal.insideMountain = true; } else { illegal.insideMountain = false; } } It works. However, how can I do this if I have multiple polylines? I am planning on drawing more shapes to represent more areas of terrain, and I want to check all of them, not just 'mountain1'. Any ideas?
Ok, I got it to work. I just created a new Active class for the mountains, and looped through that way.