From 571bab88c599571ee5bd9c6f5f8af2f3016fb19d Mon Sep 17 00:00:00 2001 From: sowgro Date: Fri, 2 Jun 2023 01:36:34 -0400 Subject: bpm is now a double --- src/devmenu/DiffEditor.java | 2 +- src/gameplay/SongPlayer.java | 2 +- src/main/Difficulty.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/devmenu/DiffEditor.java b/src/devmenu/DiffEditor.java index 6bcbd28..d53505d 100644 --- a/src/devmenu/DiffEditor.java +++ b/src/devmenu/DiffEditor.java @@ -40,7 +40,7 @@ public class DiffEditor Button save = new Button("Save"); save.setOnAction(e -> { //assigns text feilds to values diff.title = title.getText(); - diff.bpm = Integer.parseInt(bpm.getText()); + diff.bpm = Double.parseDouble(bpm.getText()); diff.numBeats = Integer.parseInt(numBeats.getText()); diff.writeMetadata(); }); diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java index 8745727..78d3a9f 100644 --- a/src/gameplay/SongPlayer.java +++ b/src/gameplay/SongPlayer.java @@ -41,7 +41,7 @@ import sound.AudioFilePlayer; public class SongPlayer extends Pane { - private int bpm; //initializes the bpm of the song, to be read in from a metadata file later + private Double bpm; //initializes the bpm of the song, to be read in from a metadata file later private int songLength; //initializes the length of the song in terms of the song's bpm, to be read in later AudioFilePlayer music; diff --git a/src/main/Difficulty.java b/src/main/Difficulty.java index c7a289a..0691675 100644 --- a/src/main/Difficulty.java +++ b/src/main/Difficulty.java @@ -17,7 +17,7 @@ public class Difficulty public String title = "Unnamed"; private ObservableList leaderboard = FXCollections.observableArrayList(); public File notes; - public int bpm; + public Double bpm; public int numBeats; public Level level; @@ -67,7 +67,7 @@ public class Difficulty JSONObject diffStuff = (JSONObject)(obj); //converts read object to a JSONObject title = (String) diffStuff.get("title"); - bpm = Integer.parseInt(diffStuff.get("bpm")+""); + bpm = Double.parseDouble(diffStuff.get("bpm")+""); numBeats = Integer.parseInt(diffStuff.get("numBeats")+""); } catch (Exception e) -- cgit v1.2.3