Introduce one presentation-free RuntimeEntityObjectLifetime for the exact entity directory and ClientObjectTable. Make GameWindow, graphical projections, retained UI, interaction, session routing, create/delete integration, and reset borrow that owner while preserving synchronous retail ordering, dormant retention, and retry semantics. Co-authored-by: Codex <codex@openai.com>
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
using AcDream.App.Streaming;
|
|
using AcDream.App.World;
|
|
using AcDream.Runtime.Entities;
|
|
|
|
namespace AcDream.App.Tests;
|
|
|
|
/// <summary>
|
|
/// Explicit isolated lifetime-group seam for App projection tests. Production
|
|
/// composition supplies its session-owned group from GameWindow; focused tests
|
|
/// use a fresh group per runtime so identity never leaks between fixtures.
|
|
/// </summary>
|
|
internal static class LiveEntityRuntimeFixture
|
|
{
|
|
public static LiveEntityRuntime Create(
|
|
GpuWorldState spatial,
|
|
ILiveEntityResourceLifecycle resources,
|
|
uint firstLocalEntityId = RuntimeEntityDirectory.FirstLocalEntityId)
|
|
{
|
|
var lifetime = new RuntimeEntityObjectLifetime(firstLocalEntityId);
|
|
return new LiveEntityRuntime(spatial, resources, lifetime);
|
|
}
|
|
|
|
public static LiveEntityRuntime Create(
|
|
GpuWorldState spatial,
|
|
ILiveEntityResourceLifecycle resources,
|
|
Action<LiveEntityRecord> tearDownRuntimeComponents,
|
|
uint firstLocalEntityId = RuntimeEntityDirectory.FirstLocalEntityId)
|
|
{
|
|
var lifetime = new RuntimeEntityObjectLifetime(firstLocalEntityId);
|
|
return new LiveEntityRuntime(
|
|
spatial,
|
|
resources,
|
|
tearDownRuntimeComponents,
|
|
lifetime);
|
|
}
|
|
|
|
public static LiveEntityRuntime Create(
|
|
GpuWorldState spatial,
|
|
ILiveEntityResourceLifecycle resources,
|
|
ILiveEntityRuntimeComponentLifecycle runtimeComponentLifecycle,
|
|
uint firstLocalEntityId = RuntimeEntityDirectory.FirstLocalEntityId)
|
|
{
|
|
var lifetime = new RuntimeEntityObjectLifetime(firstLocalEntityId);
|
|
return new LiveEntityRuntime(
|
|
spatial,
|
|
resources,
|
|
runtimeComponentLifecycle,
|
|
lifetime);
|
|
}
|
|
}
|