Package com.deco2800.game.files.stats
Class GameRecords
java.lang.Object
com.deco2800.game.files.stats.GameRecords
public class GameRecords
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GameRecords.Record
The Record class keeps a tab of the score, game number and achievements unlocked in that particular game.static class
GameRecords.Records
A mapping of the game number (nth game played) and associated record, i.e, the score and list of unlocked achievements.static class
GameRecords.Score
-
Constructor Summary
Constructors Constructor Description GameRecords()
-
Method Summary
Modifier and Type Method Description static java.util.List<BaseAchievementConfig>
getAchievementsByGame(int game)
static java.util.List<GameRecords.Score>
getAllScores()
Returns the list of scoresstatic double
getDistanceByGame(int game)
static double
getLatestDistance()
static GameRecords.Score
getLatestScore()
static GameRecords.Records
getRecords()
static GameRecords.Score
getScoreByGame(int game)
static void
setRecords(GameRecords.Records records)
Store the new records in JSON filestatic void
storeGameRecord()
Stores the records of the most recent game played into a JSON file Note: Run this method only after the in game count has updated
-
Constructor Details
-
GameRecords
public GameRecords()
-
-
Method Details
-
storeGameRecord
public static void storeGameRecord()Stores the records of the most recent game played into a JSON file Note: Run this method only after the in game count has updated -
getAchievementsByGame
- Parameters:
game
- the game number (nth game played)- Returns:
- unlocked achievements of that particular game
-
getScoreByGame
- Parameters:
game
- the game number (nth game played)- Returns:
- score of that particular game
-
getDistanceByGame
public static double getDistanceByGame(int game) -
getAllScores
Returns the list of scores- Returns:
- score of that particular game
-
getRecords
-
setRecords
Store the new records in JSON file- Parameters:
records
- new records
-
getLatestScore
-
getLatestDistance
public static double getLatestDistance()
-