}
return false;
}
});
SceneObject bestNode = null;
Node bestNodeValue = null;
for (SceneObject object : realNodes) {
if (object.validate()) {
final Node tempNode = Node.getNode(object.getId());
if (bestNode == null || tempNode.ordinal() > bestNodeValue.ordinal() ||
(tempNode.ordinal() == bestNodeValue.ordinal() &&
distanceTo(object.getLocation()) < distanceTo(bestNode.getLocation()))) {
bestNode = object;
bestNodeValue = tempNode;
}
}
}