diff options
Diffstat (limited to 'src/LivingVillage.Desktop/M6Presentation.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/M6Presentation.fs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/M6Presentation.fs b/src/LivingVillage.Desktop/M6Presentation.fs index a64d494..752034a 100644 --- a/src/LivingVillage.Desktop/M6Presentation.fs +++ b/src/LivingVillage.Desktop/M6Presentation.fs @@ -104,6 +104,13 @@ module M6Presentation = let startTickForHour (hour: float) : int64 = int64 (hour * float (Sim.ticksPerDay / 24L)) + /// Start-tick decision shared by bootstrap and new-game: an explicit evidence hour wins, + /// else daylight starts at 6:00, else midnight. Pure function, no side effects. + let resolveStartTick (startHour: float option) (startAtDaylight: bool) : int64 = + match startHour with + | Some hour -> startTickForHour hour + | None -> if startAtDaylight then 6L * Sim.ticksPerDay / 24L else 0L + let private hourOf (tick: int64) : int = int ((tick / (Sim.ticksPerDay / 24L)) % 24L) |
