aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/levelapi/Note.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-07-28 01:07:41 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-07-28 01:07:41 -0400
commit0ce09f72f4af26412356b9699d402b52dbcfc94f (patch)
treeb01b94b1b80d1f3fc5aea559b3718024b79cfe91 /src/main/java/net/sowgro/npehero/levelapi/Note.java
parentd04c277edff957d14b6261dd38da43c18b7ba189 (diff)
downloadNPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.tar.gz
NPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.tar.bz2
NPEhero-0ce09f72f4af26412356b9699d402b52dbcfc94f.zip
Finalize level API and new Json library
Diffstat (limited to 'src/main/java/net/sowgro/npehero/levelapi/Note.java')
-rw-r--r--src/main/java/net/sowgro/npehero/levelapi/Note.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/net/sowgro/npehero/levelapi/Note.java b/src/main/java/net/sowgro/npehero/levelapi/Note.java
new file mode 100644
index 0000000..ab93885
--- /dev/null
+++ b/src/main/java/net/sowgro/npehero/levelapi/Note.java
@@ -0,0 +1,34 @@
+package net.sowgro.npehero.levelapi;
+
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+
+/**
+ * A note represents a moment in the song when the player should hit a key
+ * <p>
+ * The key corresponding to the lane the note is in should be pressed
+ */
+public class Note {
+
+ public final DoubleProperty time = new SimpleDoubleProperty();
+ public final int lane;
+
+ /**
+ * Creates a new note
+ * @param time The time the player should hit the note.
+ * @param lane The lane the note belongs to.
+ */
+ public Note(double time, int lane) {
+ this.time.set(time);
+ this.lane = lane;
+ }
+
+ /**
+ * Copy constructor
+ * @param other the note to copy from
+ */
+ public Note(Note other) {
+ this.lane = other.lane;
+ this.time.set(other.time.get());
+ }
+}