refactor(runtime): extract the live object frame

This commit is contained in:
Erik 2026-07-22 00:42:26 +02:00
parent 99a3e819c4
commit 4e4aac2c5a
27 changed files with 1217 additions and 371 deletions

View file

@ -0,0 +1,24 @@
namespace AcDream.App.World;
internal interface ILiveEntityRuntimeSource
{
LiveEntityRuntime? Current { get; }
}
/// <summary>
/// One-time composition bridge for the resource-activation/runtime cycle.
/// It owns no identity or entity state; all authority remains in the bound
/// <see cref="LiveEntityRuntime"/>.
/// </summary>
internal sealed class LiveEntityRuntimeSlot : ILiveEntityRuntimeSource
{
public LiveEntityRuntime? Current { get; private set; }
public void Bind(LiveEntityRuntime runtime)
{
ArgumentNullException.ThrowIfNull(runtime);
if (Current is not null)
throw new InvalidOperationException("The live entity runtime is already bound.");
Current = runtime;
}
}