refactor(app): compose session and player startup
Move streaming, live-session, hydration, local-player, combat, and teleport construction behind the typed Phase-7 boundary. Add exact-owner runtime bindings and focused spawn-claim classification so partial startup rolls back without retaining old session targets while preserving the accepted construction and frame dependencies. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
3573da12e1
commit
7771c07fb6
31 changed files with 1759 additions and 532 deletions
|
|
@ -245,6 +245,20 @@ internal sealed class CameraPointerInputController
|
|||
_gameplayFrame = gameplayFrame;
|
||||
}
|
||||
|
||||
public IDisposable BindGameplayFrameOwned(
|
||||
GameplayInputFrameController gameplayFrame)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(gameplayFrame);
|
||||
if (_gameplayFrame is not null)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"The raw pointer owner already has a gameplay frame.");
|
||||
}
|
||||
|
||||
_gameplayFrame = gameplayFrame;
|
||||
return new GameplayFrameBinding(this, gameplayFrame);
|
||||
}
|
||||
|
||||
public void UnbindGameplayFrame(GameplayInputFrameController gameplayFrame)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(gameplayFrame);
|
||||
|
|
@ -252,6 +266,24 @@ internal sealed class CameraPointerInputController
|
|||
_gameplayFrame = null;
|
||||
}
|
||||
|
||||
private sealed class GameplayFrameBinding : IDisposable
|
||||
{
|
||||
private CameraPointerInputController? _owner;
|
||||
private readonly GameplayInputFrameController _expected;
|
||||
|
||||
public GameplayFrameBinding(
|
||||
CameraPointerInputController owner,
|
||||
GameplayInputFrameController expected)
|
||||
{
|
||||
_owner = owner;
|
||||
_expected = expected;
|
||||
}
|
||||
|
||||
public void Dispose() =>
|
||||
Interlocked.Exchange(ref _owner, null)?
|
||||
.UnbindGameplayFrame(_expected);
|
||||
}
|
||||
|
||||
public void HandleFocusChanged(bool focused)
|
||||
{
|
||||
if (!focused)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue