Add start game time feature to world generation; update API and UI to support custom start dates for in-world calendar
This commit is contained in:
@@ -45,6 +45,29 @@ public sealed class WorldGenerationServiceTests : IDisposable
|
||||
Assert.Equal("Taken", Assert.Single(await _store.ListAsync()).Name);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task StartAsync_uses_requested_start_game_time_on_the_pending_clock()
|
||||
{
|
||||
using var service = CreateService(maxConcurrentWorlds: 2);
|
||||
var start = new DateTime(1995, 6, 15, 8, 30, 0, DateTimeKind.Unspecified);
|
||||
|
||||
var summary = await service.StartAsync(new CreateWorldRequest
|
||||
{
|
||||
Name = "Custom clock",
|
||||
Latitude = 31.8966010,
|
||||
Longitude = -100.4858591,
|
||||
SizeKm = 5,
|
||||
StartGameTime = start,
|
||||
}, CancellationToken.None);
|
||||
|
||||
Assert.NotNull(summary.Clock);
|
||||
Assert.Equal(start, summary.Clock.GameTime);
|
||||
|
||||
var stored = await _store.GetSummaryAsync(summary.Id);
|
||||
Assert.NotNull(stored?.Clock);
|
||||
Assert.Equal(start, stored.Clock.GameTime);
|
||||
}
|
||||
|
||||
private WorldGenerationService CreateService(int maxConcurrentWorlds)
|
||||
{
|
||||
// The capacity check runs before any Overpass work, so this generator is never invoked by the
|
||||
|
||||
Reference in New Issue
Block a user