Search in sources :

Example 1 with DEFAULT_BACKGROUND_COLOR

use of bomb.components.hex.HexTile.DEFAULT_BACKGROUND_COLOR 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));
}
Also used : Alert(javafx.scene.control.Alert) Color(javafx.scene.paint.Color) Grid(bomb.modules.dh.hexamaze.hexalgorithm.storage.Grid) Label(javafx.scene.control.Label) Resettable(bomb.abstractions.Resettable) MazeComponent(bomb.components.hex.MazeComponent) GET_TOGGLE_NAME(bomb.tools.pattern.facade.FacadeFX.GET_TOGGLE_NAME) HexagonalPlane(bomb.modules.dh.hexamaze.hexalgorithm.storage.HexagonalPlane) RED(javafx.scene.paint.Color.RED) HexNode(bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode) Coordinates(bomb.tools.Coordinates) FXML(javafx.fxml.FXML) Quartet(org.javatuples.Quartet) ToggleGroup(javafx.scene.control.ToggleGroup) List(java.util.List) RadioButton(javafx.scene.control.RadioButton) Map(java.util.Map) DEFAULT_BACKGROUND_COLOR(bomb.components.hex.HexTile.DEFAULT_BACKGROUND_COLOR) HexTile(bomb.components.hex.HexTile) FacadeFX(bomb.tools.pattern.facade.FacadeFX) COLOR_MAP(bomb.modules.dh.hexamaze.Hexamaze.COLOR_MAP) BufferedQueue(bomb.tools.data.structures.queue.BufferedQueue) BufferedQueue(bomb.tools.data.structures.queue.BufferedQueue) HexTile(bomb.components.hex.HexTile) Color(javafx.scene.paint.Color) Map(java.util.Map)

Aggregations

Resettable (bomb.abstractions.Resettable)1 HexTile (bomb.components.hex.HexTile)1 DEFAULT_BACKGROUND_COLOR (bomb.components.hex.HexTile.DEFAULT_BACKGROUND_COLOR)1 MazeComponent (bomb.components.hex.MazeComponent)1 COLOR_MAP (bomb.modules.dh.hexamaze.Hexamaze.COLOR_MAP)1 Grid (bomb.modules.dh.hexamaze.hexalgorithm.storage.Grid)1 HexNode (bomb.modules.dh.hexamaze.hexalgorithm.storage.HexNode)1 HexagonalPlane (bomb.modules.dh.hexamaze.hexalgorithm.storage.HexagonalPlane)1 Coordinates (bomb.tools.Coordinates)1 BufferedQueue (bomb.tools.data.structures.queue.BufferedQueue)1 FacadeFX (bomb.tools.pattern.facade.FacadeFX)1 GET_TOGGLE_NAME (bomb.tools.pattern.facade.FacadeFX.GET_TOGGLE_NAME)1 List (java.util.List)1 Map (java.util.Map)1 FXML (javafx.fxml.FXML)1 Alert (javafx.scene.control.Alert)1 Label (javafx.scene.control.Label)1 RadioButton (javafx.scene.control.RadioButton)1 ToggleGroup (javafx.scene.control.ToggleGroup)1 Color (javafx.scene.paint.Color)1