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

public class BoardController extends Controller
A class representing the controller for the BOARD scene.
See Also:
  • Constructor Details

    • BoardController

      public BoardController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      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 the Pane object associated with the FXML tag of highest level in the *.fxml file associated with this. The method is called in order to process a popup. Any controller should override the method if necessary.
      Specified by:
      getTopLevelPane in class Controller
      Returns:
      the highest level Pane
    • onChangeScene

      public void onChangeScene()
      Encloses the workflow of this 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 class Controller
    • 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 of IslandGroup identifiers
      sizes - the number of islands that form each IslandGroup
      controllers - the username of the player controlling each IslandGroup
      playerTowerColors - the TowerColor of each player
      students - the students on each IslandGroup
      noEntryTiles - the number of no-entry tiles on each IslandGroup
      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.