public HashSet<EnvironmentObject> getObjectsNear(Agent agent, int radius)
{
HashSet<EnvironmentObject> objsNear = new LinkedHashSet<EnvironmentObject>();
XYLocation agentLocation = getCurrentLocationFor(agent);
foreach (XYLocation loc in objsAtLocation.keySet())
{
if (withinRadius(radius, agentLocation, loc))
{
objsNear.AddRange(objsAtLocation.get(loc));
}
}
// Ensure the 'agent' is not included in the Set of
// objects near
objsNear.remove(agent);
return objsNear;
}