refactor(app): key live projections by runtime identity

Move materialized live-object sidecars and presentation worksets to exact RuntimeEntityKey ownership. Runtime remains the only GUID/incarnation/local-ID authority while hydration, animation, effects, lights, equipped children, renderer resources, visibility, liveness, and teardown resolve exact projection identities. Preserve synchronous callbacks, local-ID allocation order, and current rendering behavior.
This commit is contained in:
Erik 2026-07-25 21:50:58 +02:00
parent e18df84437
commit 420e5eea70
73 changed files with 2939 additions and 1715 deletions

View file

@ -26,7 +26,7 @@ public sealed class WorldGenerationQuiescenceTests
world.SetLandblockAabb(LandblockId, Vector3.Zero, Vector3.One);
var nearby = new List<KeyValuePair<uint, WorldEntity>>();
Assert.True(world.IsLiveEntityVisible(ServerGuid));
Assert.True(world.IsLiveEntityVisible(entity.Id));
Assert.Single(world.LandblockEntries);
Assert.Single(world.LandblockBounds);
@ -34,7 +34,7 @@ public sealed class WorldGenerationQuiescenceTests
world.CopyLiveEntitiesNearLandblock(LandblockId, 0, nearby);
Assert.False(availability.IsWorldAvailable);
Assert.False(world.IsLiveEntityVisible(ServerGuid));
Assert.False(world.IsLiveEntityVisible(entity.Id));
Assert.Empty(world.LandblockEntries);
Assert.Empty(world.LandblockBounds);
Assert.Empty(nearby);
@ -44,7 +44,7 @@ public sealed class WorldGenerationQuiescenceTests
Assert.False(availability.End(16));
Assert.False(availability.IsWorldAvailable);
Assert.True(availability.End(17));
Assert.True(world.IsLiveEntityVisible(ServerGuid));
Assert.True(world.IsLiveEntityVisible(entity.Id));
Assert.Same(entity, Assert.Single(world.LandblockEntries).Entities.Single());
}
@ -57,7 +57,8 @@ public sealed class WorldGenerationQuiescenceTests
LandblockId,
new LandBlock(),
Array.Empty<WorldEntity>()));
world.PlaceLiveEntityProjection(LandblockId, Entity());
WorldEntity entity = Entity();
world.PlaceLiveEntityProjection(LandblockId, entity);
var selection = new SelectionState();
selection.Select(ServerGuid, SelectionChangeSource.World);
var audio = new RecordingAudioQuiescence();
@ -65,6 +66,7 @@ public sealed class WorldGenerationQuiescenceTests
availability,
selection,
world,
guid => guid == ServerGuid ? entity.Id : null,
audio);
quiescence.Begin(1);
@ -95,6 +97,7 @@ public sealed class WorldGenerationQuiescenceTests
availability,
selection,
world,
_ => null,
audio: null);
quiescence.Begin(3);