aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/levelapi/Note.java
blob: 40108671cf5ec2e9a39f3648c43a622f9d493979 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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());
    }

    public double getTime() {
        return time.get();
    }
}