Package view

Class EndGameController

java.lang.Object
view.EndGameController

public class EndGameController extends Object
  • Constructor Details

    • EndGameController

      public EndGameController()
      The EndGameController function is a constructor that initializes the EndGameController class.
  • Method Details

    • initializeLabels

      public void initializeLabels()
      The initializeLabels function initializes the scoreBoardNames and scoreBoardScores ArrayLists. The initializeLabels function also adds the labels for each player's name and score to their respective ArrayList.
    • updateScoreBoardPage

      public void updateScoreBoardPage()
      The updateScoreBoardPage function is called when the game ends. It updates the score board page with all the players' names and scores, sorted by highest to lowest score. If there are less than 4 players, then it will leave some of the fields blank. The winner's name is also displayed on this page as well.
    • setViewSharedData

      public void setViewSharedData(ViewSharedData viewSharedData)
      The setViewSharedData function is used to set the viewSharedData variable in this class. This function is called by the controller when it creates a new instance of this class. The purpose of setting the viewSharedData variable in this class is so that we can access all of its functions and variables from within our ScoreBoardPageController class, which allows us to update our scoreboard page with information about each player's score and name.
      Parameters:
      viewSharedData - viewSharedData Set the viewSharedData variable to the parameter