int maxX = -9999;
int minY = 9999;
int maxY = -9999;
for (int i = 0; i < vertices.size(); i++) {
WorldPos vertex = (WorldPos)vertices.get(i);
minX = Math.min(vertex.getX(), minX);
minY = Math.min(vertex.getY(), minY);
maxX = Math.max(vertex.getX(), maxX);
maxY = Math.max(vertex.getY(), maxY);
}
if (minX != 9999 && maxX != -9999 && minY != 9999 && maxY != -9999) {
NW = new WorldPos(minX, minY);
SE = new WorldPos(maxX, maxY);
setPosition(NW);
System.out.println(" NW : x = " + NW.getX() + " ,y = " + NW.getY());
}
}