use of bomb.tools.Coordinates in project GradleCenturion by Ultraviolet-Ninja.
the class OldMazeRunner method startingPointCalculator.
private static void startingPointCalculator(int location) {
if (location < 4)
currentLocation = new Coordinates(0, location);
else if (location < 9)
currentLocation = new Coordinates(1, location - 4);
else if (location < 15)
currentLocation = new Coordinates(2, location - 9);
else if (location < 22)
currentLocation = new Coordinates(3, location - 15);
else if (location < 28)
currentLocation = new Coordinates(4, location - 22);
else if (location < 33)
currentLocation = new Coordinates(5, location - 28);
else
currentLocation = new Coordinates(6, location - 33);
}
use of bomb.tools.Coordinates in project GradleCenturion by Ultraviolet-Ninja.
the class OldMazeRunner method popMoveOff.
private static void popMoveOff() {
historyStack.pop();
currentLocation = new Coordinates(historyStack.getTopKey());
}
use of bomb.tools.Coordinates in project GradleCenturion by Ultraviolet-Ninja.
the class OldMazeRunner method findExit.
private static LinkedList<Coordinates> findExit(HexGrid gatedGrid, final String wallOrder) {
Hex.HexNode playerPosition = gatedGrid.retrieveNode(currentLocation);
historyStack.push(new Coordinates(currentLocation), playerPosition.checkExits() + 1);
return traverseStartingNode(gatedGrid, wallOrder);
}
use of bomb.tools.Coordinates in project GradleCenturion by Ultraviolet-Ninja.
the class HexamazeController method fillHexTiles.
private static void fillHexTiles(List<HexTile> tileList, List<Coordinates> coordinatesList, int colorValue) {
Color color = RED;
for (Map.Entry<Color, Integer> entry : COLOR_MAP.entrySet()) {
if (entry.getValue() == colorValue)
color = entry.getKey();
}
for (HexTile hexTile : tileList) hexTile.setBackgroundFill(DEFAULT_BACKGROUND_COLOR);
BufferedQueue<BufferedQueue<HexTile>> tileQueues = HexagonalPlane.convertFromList(tileList);
Color finalColor = color;
coordinatesList.stream().map(c -> tileQueues.get(c.x()).get(c.y())).forEach(tile -> tile.setBackgroundFill(finalColor));
}
use of bomb.tools.Coordinates 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");
}
Aggregations