Open GoogleCodeExporter opened 8 years ago
Change to this:
private void registerEdges() {
for (int x = 0; x < mapWith; x++) {
for (int y = 0; y < mapHeight; y++) {
Node node = map.get(x).get(y);
if (!(y == 0))
node.setNorth(map.get(x).get(y - 1));
if (!(y == 0) && !(x == mapWith - 1))
node.setNorthEast(map.get(x + 1).get(y - 1));
if (!(x == mapWith - 1))
node.setEast(map.get(x + 1).get(y));
if (!(x == mapWith - 1) && !(y == mapHeight - 1))
node.setSouthEast(map.get(x + 1).get(y + 1));
if (!(y == mapHeight - 1))
node.setSouth(map.get(x).get(y + 1));
if (!(x == 0) && !(y == mapHeight - 1))
node.setSouthWest(map.get(x - 1).get(y + 1));
if (!(x == 0))
node.setWest(map.get(x - 1).get(y));
if (!(x == 0) && !(y == 0))
node.setNorthWest(map.get(x - 1).get(y - 1));
}
}
}
Original comment by rhma...@gmail.com
on 16 Sep 2014 at 12:15
Original issue reported on code.google.com by
moha...@gmail.com
on 13 Apr 2014 at 8:35