diff options
Diffstat (limited to 'src/LivingVillage.Desktop/WorldBootstrap.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/WorldBootstrap.fs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/LivingVillage.Desktop/WorldBootstrap.fs b/src/LivingVillage.Desktop/WorldBootstrap.fs index 612931b..d6b906d 100644 --- a/src/LivingVillage.Desktop/WorldBootstrap.fs +++ b/src/LivingVillage.Desktop/WorldBootstrap.fs @@ -16,10 +16,13 @@ module WorldBootstrap = let private avatarSpawnPosition = tileCenter 31 25 - let initialWorld (seed: uint64) (count: int) : World = + let private daylightStartTick = 6L * Sim.ticksPerDay / 24L + + let initialWorldForDaylight (startAtDaylight: bool) (seed: uint64) (count: int) : World = if count < 0 || count > npcSpawnTiles.Length then invalidArg (nameof count) "Desktop bootstrap supports at most 30 NPCs." + let startTick = if startAtDaylight then daylightStartTick else 0L let baseWorld = Sim.initialWorldN seed count let avatar = { baseWorld.Avatar with @@ -32,5 +35,10 @@ module WorldBootstrap = { npc with Pos = tileCenter x y }) { baseWorld with + Tick = startTick + Time = float startTick * Sim.dtSeconds Avatar = avatar Npcs = npcs } + + let initialWorld (seed: uint64) (count: int) : World = + initialWorldForDaylight false seed count |
