feat(app): Phase A.1 — job + result records for LandblockStreamer
LandblockStreamJob (Load/Unload) and LandblockStreamResult (Loaded/Failed/Unloaded) are the channel payload types the next task's LandblockStreamer will use. Separate file because they're shared between the worker thread and the render thread and deserve a focused home. Folds in two carryover nits from the Task 1 fix review: - Stale "radius + 1" comments in StreamingRegionTests updated to match the real radius+2 threshold (no numeric-assertion changes). - Single-step recenter test now asserts Visible.Count == 25 and Resident.Count == 30, locking in the Visible/Resident semantic split behaviorally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
449c2caf8b
commit
9d1c2c45e5
2 changed files with 37 additions and 4 deletions
28
src/AcDream.App/Streaming/LandblockStreamJob.cs
Normal file
28
src/AcDream.App/Streaming/LandblockStreamJob.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using AcDream.Core.World;
|
||||
|
||||
namespace AcDream.App.Streaming;
|
||||
|
||||
/// <summary>
|
||||
/// A job posted to <see cref="LandblockStreamer"/>'s inbox. Either a load
|
||||
/// (fetch this landblock from the dats and build its CPU-side mesh data)
|
||||
/// or an unload (release any state tied to this landblock on the render
|
||||
/// thread's next Tick drain).
|
||||
/// </summary>
|
||||
public abstract record LandblockStreamJob(uint LandblockId)
|
||||
{
|
||||
public sealed record Load(uint LandblockId) : LandblockStreamJob(LandblockId);
|
||||
public sealed record Unload(uint LandblockId) : LandblockStreamJob(LandblockId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Outbox record the render thread drains. Either a successful load, a
|
||||
/// failed load (logged and ignored until region recenters off/back), or
|
||||
/// an unload notification (tells the render thread to release GPU state
|
||||
/// for this landblock id).
|
||||
/// </summary>
|
||||
public abstract record LandblockStreamResult(uint LandblockId)
|
||||
{
|
||||
public sealed record Loaded(uint LandblockId, LoadedLandblock Landblock) : LandblockStreamResult(LandblockId);
|
||||
public sealed record Failed(uint LandblockId, string Error) : LandblockStreamResult(LandblockId);
|
||||
public sealed record Unloaded(uint LandblockId) : LandblockStreamResult(LandblockId);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue