using AcDream.Runtime.Entities; using AcDream.Runtime.Gameplay; using AcDream.Runtime.Physics; namespace AcDream.Runtime; /// /// 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. /// 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)); } }