Package controller
Class ScoreController
java.lang.Object
controller.ScoreController
- All Implemented Interfaces:
IScoreController
ScoreController handles communication between the Scoreboards and the GUI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfetches the personal scores for the logged in user and stores them in the correct scoreboardvoidfetchScores(ModeType difficulty) fetches scores form db, and stores them in the correct scoreboardformatScore(Score score) converts score-object to a string that will be displayed in GUI.formatScores(ArrayList<Score> scores) Scores formatted for in game view.formatScoreVerbose(Score score) converts score-object to a string that will be displayed in GUI.getScoresRaw(ModeType difficulty) get raw Score-objects.getTopFivePersonalScores(ModeType difficulty) returns the personal scores for the given difficulty formatted for guigetTopFiveScores(ModeType difficulty) returns the scores for the given difficulty formatted for guigetUserScoresRaw(ModeType difficulty) get raw Score-objects.
-
Constructor Details
-
ScoreController
public ScoreController()Constructor for ScoreController
-
-
Method Details
-
fetchScores
fetches scores form db, and stores them in the correct scoreboard- Specified by:
fetchScoresin interfaceIScoreController- Parameters:
difficulty- the difficulty to fetch scores for
-
getTopFiveScores
returns the scores for the given difficulty formatted for gui- Specified by:
getTopFiveScoresin interfaceIScoreController- Parameters:
difficulty- the difficulty to get scores for- Returns:
- the scores
-
getScoresRaw
get raw Score-objects. use with temperance- Specified by:
getScoresRawin interfaceIScoreController- Parameters:
difficulty- the difficulty to get scores for- Returns:
- the scores
-
formatScore
converts score-object to a string that will be displayed in GUI.- Specified by:
formatScorein interfaceIScoreController- Parameters:
score- the score to format- Returns:
- the formatted score
-
formatScoreVerbose
converts score-object to a string that will be displayed in GUI.- Specified by:
formatScoreVerbosein interfaceIScoreController- Parameters:
score- the score to format- Returns:
- the formatted score
-
formatScores
Scores formatted for in game view. Ex: '2. EET 3000'- Specified by:
formatScoresin interfaceIScoreController- Parameters:
scores- the scores to format- Returns:
- the formatted scores
-
fetchPersonalScores
public void fetchPersonalScores()fetches the personal scores for the logged in user and stores them in the correct scoreboard- Specified by:
fetchPersonalScoresin interfaceIScoreController
-
getTopFivePersonalScores
returns the personal scores for the given difficulty formatted for gui- Specified by:
getTopFivePersonalScoresin interfaceIScoreController- Parameters:
difficulty- the difficulty to get scores for- Returns:
- the personal scores for the given difficulty formatted for gui
-
getUserScoresRaw
Description copied from interface:IScoreControllerget raw Score-objects. use with temperance- Specified by:
getUserScoresRawin interfaceIScoreController- Parameters:
difficulty- the difficulty to get scores for- Returns:
- the scores
-