diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-05-23 07:51:51 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-05-23 07:51:51 -0400 |
commit | 1ec2cdd33df864b55cafe3326aadaf8e83cb0651 (patch) | |
tree | 4f0ad8933d6ed3a92a34452f424b73dd12030c29 /src/main | |
parent | e246c26e4b630fce269a90514185972703973fea (diff) | |
download | NPEhero-1ec2cdd33df864b55cafe3326aadaf8e83cb0651.tar.gz NPEhero-1ec2cdd33df864b55cafe3326aadaf8e83cb0651.tar.bz2 NPEhero-1ec2cdd33df864b55cafe3326aadaf8e83cb0651.zip |
add date to leaderboard
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/LeaderboardEntry.java | 14 | ||||
-rw-r--r-- | src/main/LevelController.java | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/LeaderboardEntry.java b/src/main/LeaderboardEntry.java index 61a0449..673ca11 100644 --- a/src/main/LeaderboardEntry.java +++ b/src/main/LeaderboardEntry.java @@ -7,12 +7,14 @@ public class LeaderboardEntry { private SimpleIntegerProperty score; private SimpleStringProperty name; + private SimpleStringProperty date; //all below is required for table view - public LeaderboardEntry(String name, int score) + public LeaderboardEntry(String name, int score, String date) { this.name = new SimpleStringProperty(name); this.score = new SimpleIntegerProperty(score); + this.date = new SimpleStringProperty(date); } public int getScore() { @@ -30,4 +32,14 @@ public class LeaderboardEntry public void setName(String name) { this.name.set(name); } + + public String getDate() + { + return date.get(); + } + + public void setDate(String date) + { + this.date = new SimpleStringProperty(date); + } } diff --git a/src/main/LevelController.java b/src/main/LevelController.java index f2199cf..b51da37 100644 --- a/src/main/LevelController.java +++ b/src/main/LevelController.java @@ -13,7 +13,7 @@ public class LevelController { Difficulty d1 = new Difficulty(); d1.title = "Easy"; - LeaderboardEntry lb = new LeaderboardEntry("t-bone", 1000); + LeaderboardEntry lb = new LeaderboardEntry("t-bone", 1000, "DATE"); //lb.setName("t-bone"); //lb.setScore(1000); d1.leaderboard.add(lb); |