diff --git a/source/funkin/play/notes/notekind/NoteKind.hx b/source/funkin/play/notes/notekind/NoteKind.hx index 77b2bbc45..8b87e0442 100644 --- a/source/funkin/play/notes/notekind/NoteKind.hx +++ b/source/funkin/play/notes/notekind/NoteKind.hx @@ -18,6 +18,16 @@ class NoteKind implements INoteScriptedClass */ public var description:String = ""; + /** + * this only exists for people that don't like calling functions + */ + var notes(get, never):Array; + + function get_notes():Array + { + return this.getNotes(); + } + public function new(noteKind:String, description:String = "") { this.noteKind = noteKind; @@ -29,6 +39,18 @@ class NoteKind implements INoteScriptedClass return noteKind; } + /** + * Retrieve all notes of this kind + * @return Array + */ + function getNotes():Array + { + var allNotes:Array = PlayState.instance.playerStrumline.notes.members.concat(PlayState.instance.opponentStrumline.notes.members); + return allNotes.filter(function(note:NoteSprite) { + return note != null && note.noteData.kind == this.noteKind; + }); + } + public function onScriptEvent(event:ScriptEvent):Void {} public function onCreate(event:ScriptEvent):Void {}