public IntCouple GetNext(int x, int y) { var next = new DijkstraStart { X = 0, Y = 0, Val = int.MaxValue }; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (x + i >= 0 && x + i < Map.MAP_WIDTH && y + j >= 0 && y + j < Map.MAP_HEIGHT && _pathMap[x + i, y + j] < next.Val) { next = new DijkstraStart { X = x + i, Y = y + j, Val = _pathMap[x + i, y + j] }; } } } return(new IntCouple { X = next.X, Y = next.Y }); }
public IntCouple GetNext(int x, int y) { var next = new DijkstraStart { X = 0, Y = 0, Val = int.MaxValue }; for (int i = -1; i < 2; i++) for (int j = -1; j < 2; j++) { if (x + i >= 0 && x + i < Map.MAP_WIDTH && y + j >= 0 && y + j < Map.MAP_HEIGHT && _pathMap[x + i, y + j] < next.Val) { next = new DijkstraStart { X = x + i, Y = y + j, Val = _pathMap[x + i, y + j] }; } } return new IntCouple { X = next.X, Y = next.Y }; }