use of bomb.components.hex.HexTile 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));
}
Aggregations