Class BoardController
java.lang.Object
it.polimi.ingsw.eriantys.client.gui.controllers.Controller
it.polimi.ingsw.eriantys.client.gui.controllers.BoardController
- All Implemented Interfaces:
javafx.fxml.Initializable
A class representing the controller for the
BOARD scene.- See Also:
-
SceneName.BOARDScene
-
Field Summary
Fields inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
app, client, showError, showInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawIslands(List<String> islands, Map<String, Integer> sizes, Map<String, String> controllers, Map<String, String> playerTowerColors, Map<String, Map<String, Integer>> students, Map<String, Integer> noEntryTiles, String motherNatureIsland) Draws all the islands and their components.javafx.scene.layout.PaneA getter for thePaneobject associated with the FXML tag of highest level in the*.fxmlfile associated withthis.protected voidInitializes the miniature images of the character cards to show when a character card is selected.voidinitialize(URL url, ResourceBundle resourceBundle) Gets all the child nodes representing the elements of the board from the FXML.voidload()Loads the board status and draws all the elements of the scene.voidEncloses the workflow ofthison a scene change event.Methods inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
applyGrayscale, applyGreenShade, roundBorders, setApp, setClient, setShowError, setShowInfo
-
Constructor Details
-
BoardController
public BoardController()
-
-
Method Details
-
initialize
Gets all the child nodes representing the elements of the board from the FXML. Initializes all the images for the scene from the resource files. Sets some event handlers.- See Also:
-
EventHandler
-
getTopLevelPane
public javafx.scene.layout.Pane getTopLevelPane()Description copied from class:ControllerA getter for thePaneobject associated with the FXML tag of highest level in the*.fxmlfile associated withthis. The method is called in order to process a popup. Any controller should override the method if necessary.- Specified by:
getTopLevelPanein classController- Returns:
- the highest level
Pane
-
onChangeScene
public void onChangeScene()Encloses the workflow ofthison a scene change event. The method is called before the implementation of the controller itself to pre-process eventual data. The default behaviour of the method returns immediately. Any controller should override the method if necessary. Draws the selected color or character card, which could change when changing to another scene and back.- Overrides:
onChangeScenein classController
-
load
public void load()Loads the board status and draws all the elements of the scene. -
drawIslands
protected void drawIslands(List<String> islands, Map<String, Integer> sizes, Map<String, String> controllers, Map<String, String> playerTowerColors, Map<String, Map<String, Integer>> students, Map<String, Integer> noEntryTiles, String motherNatureIsland) Draws all the islands and their components. Updates the event handlers according to what is selected (character card, student, or nothing).- Parameters:
islands- the list ofIslandGroupidentifierssizes- the number of islands that form eachIslandGroupcontrollers- the username of the player controlling eachIslandGroupplayerTowerColors- theTowerColorof each playerstudents- the students on eachIslandGroupnoEntryTiles- the number of no-entry tiles on eachIslandGroupmotherNatureIsland- The identifier of the island on which Mother Nature is
-
initCharacterMiniatures
protected void initCharacterMiniatures()Initializes the miniature images of the character cards to show when a character card is selected.
-