gpml/scene/periodmanager.gd

26 lines
383 B
GDScript3
Raw Normal View History

2024-05-25 18:50:50 +02:00
extends Node
var periods = []
var last_period = null
func add(date):
if last_period != null:
last_period.end = date
last_period = null
dump()
return
# If no new period has begun
var period = Period.new()
period.begin = date
periods.append(period)
last_period = period
dump()
func dump():
for period in periods:
print("%s - %s" % [period.begin, period.end])