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.BOARD
Scene
-
Field Summary
Fields inherited from class it.polimi.ingsw.eriantys.client.gui.controllers.Controller
app, client, showError, showInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.javafx.scene.layout.Pane
A getter for thePane
object associated with the FXML tag of highest level in the*.fxml
file associated withthis
.protected void
Initializes the miniature images of the character cards to show when a character card is selected.void
initialize
(URL url, ResourceBundle resourceBundle) Gets all the child nodes representing the elements of the board from the FXML.void
load()
Loads the board status and draws all the elements of the scene.void
Encloses the workflow ofthis
on 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:Controller
A getter for thePane
object associated with the FXML tag of highest level in the*.fxml
file associated withthis
. The method is called in order to process a popup. Any controller should override the method if necessary.- Specified by:
getTopLevelPane
in classController
- Returns:
- the highest level
Pane
-
onChangeScene
public void onChangeScene()Encloses the workflow ofthis
on 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:
onChangeScene
in 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 ofIslandGroup
identifierssizes
- the number of islands that form eachIslandGroup
controllers
- the username of the player controlling eachIslandGroup
playerTowerColors
- theTowerColor
of each playerstudents
- the students on eachIslandGroup
noEntryTiles
- the number of no-entry tiles on eachIslandGroup
motherNatureIsland
- 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.
-