Skip to content

A leaderboard of a chosen size with player names, scores, and dates/times.

Notifications You must be signed in to change notification settings

17livincent/leaderboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Leaderboard

This code implements a game leaderboard of a chosen size with fields player-name, score (templated/generic), and a date/time. There are two versions. One is in C++ and another is in Java, which can use serialization.

Getting the code

    git clone https://github.com/17livincent/Leaderboard.git

Or

    git clone [email protected]:17livincent/Leaderboard.git

Usage

For the C++ version, simply #include "leaderboard.h" and use the various methods to interact with it. run.cpp implements leaderboard.h for testing purposes. For the Java version, simply reference the Leaderboard class in your code. Run.java is also a testing program for Leaderboard.java.

Features include:

  • A ranking struct/class with player name, score, and time parameters.
  • A choosable and updatable size for the leaderboard, as well as the option to clear the leaderboard.
  • A templated/generic score field in the ranking to be able to hold any type of data (int, double, string, ...). However, for C++, it must be a primitive. For Java, the compareTo(T A, T B) method must be updated for the score type.
  • The capability of specifying the hierarchy of the scoring, such as whether a numerically greater/lesser score is higher or lower.
  • For the Java version, the ability to save the current leaderboard info to a text file in order to reload it in the future.

About

A leaderboard of a chosen size with player names, scores, and dates/times.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published