Multiple chart editor bug fixes +tweaks
This commit is contained in:
@@ -32,10 +32,7 @@ class SongDataUtils
|
||||
return new SongNoteData(time, data, length, kind);
|
||||
};
|
||||
|
||||
trace(notes);
|
||||
trace(notes[0]);
|
||||
var result = [for (i in 0...notes.length) offsetNote(notes[i])];
|
||||
trace(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -54,6 +51,36 @@ class SongDataUtils
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an array of SongNoteData objects, return a new array of SongNoteData objects
|
||||
* which excludes any notes whose timestamps are outside of the given range.
|
||||
* @param notes The notes to modify.
|
||||
* @param startTime The start of the range in milliseconds.
|
||||
* @param endTime The end of the range in milliseconds.
|
||||
* @return The filtered array of notes.
|
||||
*/
|
||||
public static function clampSongNoteData(notes:Array<SongNoteData>, startTime:Float, endTime:Float):Array<SongNoteData>
|
||||
{
|
||||
return notes.filter(function(note:SongNoteData):Bool {
|
||||
return note.time >= startTime && note.time <= endTime;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an array of SongEventData objects, return a new array of SongEventData objects
|
||||
* which excludes any events whose timestamps are outside of the given range.
|
||||
* @param events The events to modify.
|
||||
* @param startTime The start of the range in milliseconds.
|
||||
* @param endTime The end of the range in milliseconds.
|
||||
* @return The filtered array of events.
|
||||
*/
|
||||
public static function clampSongEventData(events:Array<SongEventData>, startTime:Float, endTime:Float):Array<SongEventData>
|
||||
{
|
||||
return events.filter(function(event:SongEventData):Bool {
|
||||
return event.time >= startTime && event.time <= endTime;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new array without a certain subset of notes from an array of SongNoteData objects.
|
||||
* Does not mutate the original array.
|
||||
|
||||
Reference in New Issue
Block a user