DayNightCycleService — derives time-of-day transitions from a clock and emits time_of_day_changed / day_night_transition_progress_changed on the clock's bus. Instantiated at runtime by TimeHost per clock. Reads times_of_day from clock.calendar.times_of_day — does NOT own its own list. The calendar is the schema; TODs are part of the schema; clocks inherit the schema from the calendar they bind.
Source: addons/calendar_time/day_night_cycle/service/day_night_cycle_service.gd
Syntax
class DayNightCycleService extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
DayNightCycleServiceLogic | Field | The clock this service derives time-of-day from. Subscribes to the bus for `date_time_changed` / `clock_state_loaded` and emits `time_of_day_changed` / `day_night_transition_progress_changed` back on the same bus. Set on construction by the host; the service doesn't pick its clock — the consumer does. `DayNightCycleServiceLogic` is preloaded here, holding the cycle math this service uses. |
ClockValidator | Field | `ClockValidator` is preloaded here to validate the service's bound clock. |
clock | Property | This clock's date and time drive the day-night cycle. |
time_of_day | Property | The current time-of-day for the clock's current instant. `null` when the clock is unbound or has no calendar TODs. |
last_time_of_day | Property | Most recently entered time-of-day stage, used to detect transitions. |
transition_progress | Property | Tracks progress through the active time-of-day lighting transition. |
reset | Method | |
get_previous_time_of_day | Method | |
calculate_time_of_day | Method | |
calculate_time_of_day_with_hours_time | Method | |
get_last_enter_time | Method | |
validate | Method |