refactor(app): compose live presentation startup
This commit is contained in:
parent
aa6ffa5176
commit
88f32dc4e2
23 changed files with 1767 additions and 626 deletions
|
|
@ -103,6 +103,12 @@ internal sealed class DeferredCanonicalWorldEntityCountSource
|
|||
_target = target;
|
||||
}
|
||||
|
||||
public IDisposable BindOwned(GpuWorldState target)
|
||||
{
|
||||
Bind(target);
|
||||
return new Binding(this, target);
|
||||
}
|
||||
|
||||
public void Unbind(GpuWorldState target)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(target);
|
||||
|
|
@ -115,6 +121,23 @@ internal sealed class DeferredCanonicalWorldEntityCountSource
|
|||
_deactivated = true;
|
||||
_target = null;
|
||||
}
|
||||
|
||||
private sealed class Binding : IDisposable
|
||||
{
|
||||
private DeferredCanonicalWorldEntityCountSource? _owner;
|
||||
private readonly GpuWorldState _target;
|
||||
|
||||
public Binding(
|
||||
DeferredCanonicalWorldEntityCountSource owner,
|
||||
GpuWorldState target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public void Dispose() =>
|
||||
Interlocked.Exchange(ref _owner, null)?.Unbind(_target);
|
||||
}
|
||||
}
|
||||
|
||||
internal interface IDevToolsPlayerModeCommands
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue