refactor(runtime): cut graphical host over to canonical root

Make every App composition phase borrow one GameRuntime, retire the duplicate view/event adapters, and dispose the root only after its graphical borrowers release. This preserves synchronous UI commands while giving shutdown one exact ownership ledger.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-26 19:06:09 +02:00
parent ecb9f79444
commit ce41efb9e5
29 changed files with 613 additions and 778 deletions

View file

@ -31,7 +31,17 @@ internal sealed class UpdateFrameClock
: IPhysicsScriptTimeSource,
IGameRuntimeClock
{
private readonly GameRuntimeClock _runtime = new();
private readonly GameRuntimeClock _runtime;
public UpdateFrameClock()
: this(new GameRuntimeClock())
{
}
public UpdateFrameClock(GameRuntimeClock runtime)
{
_runtime = runtime ?? throw new ArgumentNullException(nameof(runtime));
}
public ulong FrameNumber => _runtime.FrameNumber;
public double SimulationTimeSeconds => _runtime.SimulationTimeSeconds;