refactor(streaming): capture landblock build origin

This commit is contained in:
Erik 2026-07-21 20:12:56 +02:00
parent 2216a02de5
commit 090b0354ff
8 changed files with 522 additions and 54 deletions

View file

@ -0,0 +1,36 @@
namespace AcDream.App.Streaming;
/// <summary>
/// Immutable world-origin center captured by the update thread when a
/// landblock load is admitted. Worker construction and render publication use
/// this same value, so a later recenter cannot combine two coordinate frames.
/// </summary>
public readonly record struct LandblockBuildOrigin
{
public LandblockBuildOrigin(int centerX, int centerY)
{
CenterX = centerX;
CenterY = centerY;
IsSpecified = true;
}
public int CenterX { get; }
public int CenterY { get; }
/// <summary>
/// Distinguishes a captured origin at the valid map coordinate (0,0)
/// from an old compatibility request that carries no origin at all.
/// </summary>
public bool IsSpecified { get; }
}
/// <summary>
/// Complete immutable input to one CPU-side landblock build.
/// <see cref="Generation"/> is carried for matching and diagnostics only;
/// residency policy remains owned by <see cref="StreamingController"/>.
/// </summary>
public readonly record struct LandblockBuildRequest(
uint LandblockId,
LandblockStreamJobKind Kind,
ulong Generation,
LandblockBuildOrigin Origin);