gpml/scene/periodmanager.gd
2024-05-25 18:50:50 +02:00

26 lines
383 B
GDScript

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])