From fcd65070900865a9e0b547c49968988abcda5ab9 Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 25 May 2023 20:57:51 -0400 Subject: Move levels outside of src, prepare for leaderboard writing and other small changes --- src/main/Difficulty.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main/Difficulty.java') diff --git a/src/main/Difficulty.java b/src/main/Difficulty.java index 926d8d6..7955698 100644 --- a/src/main/Difficulty.java +++ b/src/main/Difficulty.java @@ -1,17 +1,19 @@ package main; import java.io.File; - +import java.time.LocalDate; import javafx.collections.FXCollections; import javafx.collections.ObservableList; public class Difficulty { public String title; - public ObservableList leaderboard = FXCollections.observableArrayList(); + private ObservableList leaderboard = FXCollections.observableArrayList(); public File notes; + public int bpm; public void parseMetadata(File file) { + //hi zach put json reader stuff here title = "placeholderDiff"; } @@ -19,4 +21,13 @@ public class Difficulty //and here leaderboard.add(new LeaderboardEntry("placeholderScore", 0, "0/0/0")); } + + public void addToLeaderboard(String name, int score) { + leaderboard.add(new LeaderboardEntry(name, score, ""+LocalDate.now())); //do not delete this tho its not a placeholder + //and make this write to the json also + } + + public ObservableList getLeaderboard() { + return leaderboard; + } } -- cgit v1.2.3