Refactor rhythm action architecture
This commit is contained in:
17
resources/chart_track.gd
Normal file
17
resources/chart_track.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
class_name ChartTrack
|
||||
extends Resource
|
||||
|
||||
@export var track_id: StringName = &""
|
||||
@export var track_type: StringName = &""
|
||||
@export var events: Array = []
|
||||
|
||||
|
||||
func sorted_events() -> Array:
|
||||
var result: Array = []
|
||||
for event in events:
|
||||
if event is Resource:
|
||||
result.append(event)
|
||||
result.sort_custom(func(a: Resource, b: Resource) -> bool:
|
||||
return float(a.call("beat_position")) < float(b.call("beat_position"))
|
||||
)
|
||||
return result
|
||||
Reference in New Issue
Block a user