refactor(runtime): acknowledge exact world host projections

This commit is contained in:
Erik 2026-07-26 18:27:41 +02:00
parent 73d0b54e38
commit 18d17d8bb1
17 changed files with 1677 additions and 72 deletions

View file

@ -6,6 +6,7 @@ using AcDream.App.Rendering.Scene;
using AcDream.App.Streaming;
using AcDream.App.UI.Testing;
using AcDream.Runtime;
using AcDream.Runtime.World;
using SixLabors.ImageSharp;
namespace AcDream.App.Tests.Diagnostics;
@ -179,6 +180,19 @@ public sealed class WorldLifecycleAutomationControllerTests
Path.Combine(directory, "screenshots"));
var controller = new WorldLifecycleAutomationController(
() => reveal,
() => new RuntimeWorldEnvironmentOwnershipSnapshot(
IsInitialized: true,
DayGroupDefinitionCount: 4,
ActiveDayGroupCount: 1),
() => new RuntimeWorldTransitOwnershipSnapshot(
BufferedTeleportDestinationCount: 0,
PendingTeleportStartCount: 0,
ActiveTeleportCount: 0,
AcceptedTeleportDestinationCount: 0,
ActiveRevealCount: 0,
PendingDestinationReadinessCount: 0,
HostProjectionCount: 0,
PendingHostAcknowledgementCount: 0),
() => 3,
_ => resources,
screenshots,
@ -205,6 +219,15 @@ public sealed class WorldLifecycleAutomationControllerTests
using JsonDocument json = JsonDocument.Parse(line);
Assert.Equal("dungeon", json.RootElement.GetProperty("name").GetString());
Assert.Equal(7, json.RootElement.GetProperty("reveal").GetProperty("generation").GetInt64());
Assert.Equal(
4,
json.RootElement.GetProperty("environmentOwnership")
.GetProperty("dayGroupDefinitionCount").GetInt32());
Assert.Equal(
0,
json.RootElement.GetProperty("transitOwnership")
.GetProperty("pendingHostAcknowledgementCount")
.GetInt32());
Assert.Equal(4, json.RootElement.GetProperty("render").GetProperty("world")
.GetProperty("visibleLandblocks").GetInt32());
Assert.True(json.RootElement.GetProperty("render").GetProperty("presentation")
@ -373,6 +396,8 @@ public sealed class WorldLifecycleAutomationControllerTests
string directory,
Func<RenderFrameOutcome, WorldLifecycleResourceSnapshot> capture) =>
new(
() => default,
() => default,
() => default,
() => 0,
capture,