Class Leaderboard

java.lang.Object
database.entity.Leaderboard

@Entity public class Leaderboard extends Object
Entity that is respoonsible mapping data to Leaderboard table in database. This table contains all the scores of the players.
  • Field Details

    • scoreid

      private Long scoreid
      scoreid is the primary key of the table. It's generated automatically by the database.
    • accountid

      private Account accountid
      accountid is the foreign key of the table. It's used to connect the score to the account. Each account can have multiple scores. Each score can only belong to one account.
    • time

      private Double time
      Finishing time of the game.
    • points

      private int points
      points of the score.
    • difficulty

      private ModeType difficulty
      Difficulty of the played game.
    • timestamp

      private Date timestamp
      Timestamp of the score.
  • Constructor Details

    • Leaderboard

      public Leaderboard()
      Empty constructor required by Hibernate
    • Leaderboard

      public Leaderboard(Account accountid, Double time, int points, ModeType difficulty, Date timestamp)
      Constructor for Leaderboard class.
      Parameters:
      accountid - - see accountid
      time - - see time
      difficulty - - see difficulty
      timestamp - - see timestamp
  • Method Details

    • getTimestamp

      public Date getTimestamp()
      Getter for timestamp
      Returns:
      - see timestamp
    • setTimestamp

      public void setTimestamp(Date timestamp)
      Setter for timestamp
      Parameters:
      timestamp - - see timestamp
    • getAccountid

      public Account getAccountid()
      Getter for accountid
      Returns:
      - see accountid
    • setAccountid

      public void setAccountid(Account accountid)
      Setter for accountid
      Parameters:
      accountid - - see accountid
    • getAccountid

      public void getAccountid(Account userid)
      Setter for accountid
      Parameters:
      userid - - see accountid
    • getDifficulty

      public ModeType getDifficulty()
      Getter for difficulty
      Returns:
      - see difficulty
    • setDifficulty

      public void setDifficulty(ModeType difficulty)
      Setter for difficulty
      Parameters:
      difficulty - - see difficulty
    • getTime

      public Double getTime()
      Getter for time
      Returns:
      - see time
    • setTime

      public void setTime(Double seconds)
      Setter for time
      Parameters:
      seconds - - see time
    • getScoreid

      public Long getScoreid()
      Getter for scoreid
      Returns:
      - see scoreid
    • setScoreid

      public void setScoreid(Long scoreid)
      Setter for scoreid
      Parameters:
      scoreid - - see scoreid
    • getPoints

      public int getPoints()
      Getter for points
      Returns:
      - see points
    • setPoints

      public void setPoints(int points)
      Setter for points
      Parameters:
      points - - see points
    • toString

      public String toString()
      toString method for Leaderboard class.
      Overrides:
      toString in class Object
      Returns:
      - String representation of the class.