refactor(runtime): close simulation ownership
Move remote-motion construction, CreateObject vector initialization, final simulation-component retirement, and the combined J5 ownership ledger into Runtime. Delete App compatibility views and moved-state reconstruction while preserving the existing graphical projection and retail update order.
This commit is contained in:
parent
c30a3efeb0
commit
cdee7a4b49
57 changed files with 1013 additions and 410 deletions
44
src/AcDream.Runtime/RuntimeSimulationOwnership.cs
Normal file
44
src/AcDream.Runtime/RuntimeSimulationOwnership.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using AcDream.Runtime.Entities;
|
||||
using AcDream.Runtime.Gameplay;
|
||||
using AcDream.Runtime.Physics;
|
||||
|
||||
namespace AcDream.Runtime;
|
||||
|
||||
/// <summary>
|
||||
/// One allocation-free terminal ownership ledger for the complete J5
|
||||
/// presentation-independent simulation graph. It owns no mutable state.
|
||||
/// Graphical and no-window hosts inspect the same canonical owners.
|
||||
/// </summary>
|
||||
public readonly record struct RuntimeSimulationOwnershipSnapshot(
|
||||
RuntimeEntityObjectOwnershipSnapshot EntityObjects,
|
||||
RuntimePhysicsOwnershipSnapshot Physics,
|
||||
RuntimeGameplayOwnershipSnapshot Gameplay)
|
||||
{
|
||||
public bool IsConverged =>
|
||||
EntityObjects.IsConverged
|
||||
&& Physics.IsConverged
|
||||
&& Gameplay.IsConverged;
|
||||
}
|
||||
|
||||
public static class RuntimeSimulationOwnership
|
||||
{
|
||||
public static RuntimeSimulationOwnershipSnapshot Capture(
|
||||
RuntimeEntityObjectLifetime entityObjects,
|
||||
RuntimeInventoryState inventory,
|
||||
RuntimeCharacterState character,
|
||||
RuntimeCommunicationState communication,
|
||||
RuntimeActionState actions,
|
||||
RuntimeLocalPlayerMovementState movement)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(entityObjects);
|
||||
return new RuntimeSimulationOwnershipSnapshot(
|
||||
entityObjects.CaptureOwnership(),
|
||||
entityObjects.Physics.CaptureOwnership(),
|
||||
RuntimeGameplayOwnership.Capture(
|
||||
inventory,
|
||||
character,
|
||||
communication,
|
||||
actions,
|
||||
movement));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue