use of bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode in project GradleCenturion by Ultraviolet-Ninja.
the class MazeSearch method moveToNextSegment.
private static void moveToNextSegment(BufferedQueue<BufferedQueue<HexNode>> pillar, HexagonalPlane copy) {
BufferedQueue<BufferedQueue<HexNode>> copiedQueues = copy.getBufferedQueues();
for (BufferedQueue<HexNode> column : copiedQueues) column.removeFirst();
int index = 0;
for (BufferedQueue<HexNode> column : pillar) {
HexNode nextNode = column.removeFirst();
copiedQueues.get(index++).add(nextNode);
}
}
use of bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode in project GradleCenturion by Ultraviolet-Ninja.
the class MazeRunner method findStartingLocation.
private static Coordinates findStartingLocation(Grid grid) {
BufferedQueue<BufferedQueue<HexNode>> gridQueues = grid.getHexagon().getBufferedQueues();
int size = gridQueues.size();
for (int x = 0; x < size; x++) {
BufferedQueue<HexNode> column = gridQueues.get(x);
for (int y = 0; y < column.size(); y++) {
HexNode currentNode = column.get(y);
if (currentNode.getColor() != -1)
return new Coordinates(x, y);
}
}
throw new RuntimeException("Failed to find start position");
}
use of bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode in project GradleCenturion by Ultraviolet-Ninja.
the class ExitCheckerTest method setPegLocations.
public static void setPegLocations(@NotNull Grid grid, Set<Integer> locations) {
BufferedQueue<BufferedQueue<HexNode>> gridQueues = grid.getHexagon().getBufferedQueues();
int locationCounter = 0;
for (BufferedQueue<HexNode> column : gridQueues) {
for (HexNode node : column) {
if (locations.contains(locationCounter++))
node.setColor(RED_PEG_VALUE);
}
}
}
use of bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode in project GradleCenturion by Ultraviolet-Ninja.
the class MazeRunner method mapSingleNode.
private static void mapSingleNode(Grid grid, Graph<Coordinates, DefaultEdge> graph, HexWall correspondingWall, Coordinates from, Coordinates to) {
HexNode currentNode = grid.getAtCoordinates(from);
HexNode checkExists = grid.getAtCoordinates(to);
if (checkExists == null || currentNode.isPathBlocked(correspondingWall))
return;
graph.addVertex(from);
graph.addVertex(to);
graph.addEdge(from, to);
}
Aggregations