Class GameRecords.Records

java.lang.Object
com.deco2800.game.files.stats.GameRecords.Records
Enclosing class:
GameRecords

public static class GameRecords.Records
extends java.lang.Object
A mapping of the game number (nth game played) and associated record, i.e, the score and list of unlocked achievements.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.util.Map<java.lang.Integer,​GameRecords.Record> records
    An ordered mapping of the game number and associated achievements
  • Constructor Summary

    Constructors 
    Constructor Description
    Records()  
  • Method Summary

    Modifier and Type Method Description
    void add​(GameRecords.Record record)
    Add a new record to the mapping
    GameRecords.Record findByGame​(int game)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • records

      public java.util.Map<java.lang.Integer,​GameRecords.Record> records
      An ordered mapping of the game number and associated achievements
  • Constructor Details

  • Method Details

    • findByGame

      public GameRecords.Record findByGame​(int game)
      Parameters:
      game - the game number
      Returns:
      records of a particular game (null if absent)
    • add

      public void add​(GameRecords.Record record)
      Add a new record to the mapping
      Parameters:
      record - the record to be added