mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 21:06:16 +00:00
28 lines
505 B
Java
28 lines
505 B
Java
package land.chipmunk.chipmunkmod.song;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
@AllArgsConstructor
|
|
public class Note implements Comparable<Note> {
|
|
public Instrument instrument;
|
|
public int pitch;
|
|
public float volume;
|
|
public long time;
|
|
|
|
@Override
|
|
public int compareTo(Note other) {
|
|
if (time < other.time) {
|
|
return -1;
|
|
}
|
|
else if (time > other.time) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public int noteId () {
|
|
return pitch + instrument.id * 25;
|
|
}
|
|
}
|