Rename observed facades as entity snapshots
This commit is contained in:
parent
8f2ed3326b
commit
ee0f73d40d
17 changed files with 152 additions and 152 deletions
|
|
@ -2312,7 +2312,7 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
if (zoneRenderer.Contains("foreach (var entity in legacyEntityFacadeZone.Entities)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ZoneRenderer must use the daemon-indexed observed facade projection supplied by gameplay instead of enumerating Unity Zone.Entities.");
|
||||
"ZoneRenderer must use the daemon-indexed observed entity projection supplied by gameplay instead of enumerating Unity Zone.Entities.");
|
||||
}
|
||||
|
||||
if (zoneRenderer.Contains("_legacyEntityFacadeZone", StringComparison.Ordinal) ||
|
||||
|
|
@ -2322,7 +2322,7 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
zoneRenderer.Contains("gridObject.Zone = ", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ZoneRenderer must not keep Unity Zone facade handles; daemon snapshots and observed facade projections own renderer input.");
|
||||
"ZoneRenderer must not keep Unity Zone facade handles; daemon snapshots and observed entity projections own renderer input.");
|
||||
}
|
||||
|
||||
if (zoneRenderer.Contains("PerspectiveEntity.EntityInfoGathered", StringComparison.Ordinal))
|
||||
|
|
@ -2360,7 +2360,7 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
"private readonly Dictionary<int, AetheriaRuntimeDaemonCompassMarker> _daemonCompassMarkersByEntityIndex",
|
||||
"private readonly Dictionary<int, AetheriaRuntimeZoneTargetRow> _daemonTargetRowsByEntityIndex",
|
||||
"private readonly List<AetheriaRuntimeZoneContactRow> _daemonContactRows",
|
||||
"private IReadOnlyDictionary<int, Entity> _observedEntityFacadesByDaemonIndex",
|
||||
"private IReadOnlyDictionary<int, Entity> _observedEntitySnapshotsByDaemonIndex",
|
||||
"private readonly List<int> _daemonPresentationEntityIndices",
|
||||
"private readonly HashSet<int> _daemonPresentationEntityIndicesSet",
|
||||
"private readonly List<int> _daemonVisibleEntityIndices",
|
||||
|
|
@ -2371,14 +2371,14 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
"_daemonWormholeExits.Add(new AetheriaRuntimeDaemonWormholeExit(",
|
||||
"public Dictionary<int, (GameObject gravity, CompassIcon icon)> WormholeInstances",
|
||||
"public void LoadDaemonZoneView(",
|
||||
"IReadOnlyDictionary<int, Entity> observedEntityFacadesByDaemonIndex,",
|
||||
"IReadOnlyDictionary<int, Entity> observedEntitySnapshotsByDaemonIndex,",
|
||||
"AetheriaRuntimeZoneRenderDocument render)",
|
||||
"public BodySettingsCollection[] BodySettingsCollections;",
|
||||
"public void ApplyZoneRender(AetheriaRuntimeZoneRenderDocument render)",
|
||||
"_daemonCurrentEntityKey = render?.CurrentEntityKey ?? \"\";",
|
||||
"_daemonSimulationTimeSeconds = render?.SimulationTimeSeconds ?? 0;",
|
||||
"_zoneRenderBodies = render?.Bodies ?? Array.Empty<AetheriaRuntimeBodySnapshotCommit>();",
|
||||
"_observedEntityFacadesByDaemonIndex = observedEntityFacadesByDaemonIndex;",
|
||||
"_observedEntitySnapshotsByDaemonIndex = observedEntitySnapshotsByDaemonIndex;",
|
||||
"render?.ZoneRenderRadius ?? 2000",
|
||||
"private readonly HashSet<string> _daemonVisibleBodyKeys",
|
||||
"private void SyncDaemonBodyViews()",
|
||||
|
|
@ -2399,7 +2399,7 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
".Viewports",
|
||||
".Objects(ToViewportBounds(viewport))",
|
||||
"foreach (var entity in objects?.Objects ?? Array.Empty<AetheriaRuntimeRtsViewportObject>())",
|
||||
"_observedEntityFacadesByDaemonIndex.TryGetValue(entityIndex, out var entity)",
|
||||
"_observedEntitySnapshotsByDaemonIndex.TryGetValue(entityIndex, out var entity)",
|
||||
"Loading entity {entity.Name} from daemon presentation query",
|
||||
"UnloadEntity(pair.Value.Entity)",
|
||||
"private readonly Dictionary<int, EntityInstance> _entityInstancesByDaemonIndex",
|
||||
|
|
@ -2999,7 +2999,7 @@ static void RequireTypedRuntimeBehaviorCoverage(string root)
|
|||
{
|
||||
var itemManagerPath = Path.Combine(root, "Assets", "Scripts", "ServerShared", "ItemManager.cs");
|
||||
var actionGameManagerPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "ActionGameManager.cs");
|
||||
var observedFacadeProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedFacadeProjector.cs");
|
||||
var observedEntityProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedEntityProjector.cs");
|
||||
|
||||
var itemManager = File.Exists(itemManagerPath)
|
||||
? File.ReadAllText(itemManagerPath)
|
||||
|
|
@ -3007,10 +3007,10 @@ static void RequireTypedRuntimeBehaviorCoverage(string root)
|
|||
var actionGameManager = File.Exists(actionGameManagerPath)
|
||||
? File.ReadAllText(actionGameManagerPath)
|
||||
: throw new InvalidOperationException("Cannot verify typed runtime behavior coverage; ActionGameManager.cs is missing.");
|
||||
var observedFacadeProjector = File.Exists(observedFacadeProjectorPath)
|
||||
? File.ReadAllText(observedFacadeProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify typed runtime behavior coverage; AetheriaUnityObservedFacadeProjector.cs is missing.");
|
||||
var runtimeRestoreSource = actionGameManager + "\n" + observedFacadeProjector;
|
||||
var observedEntityProjector = File.Exists(observedEntityProjectorPath)
|
||||
? File.ReadAllText(observedEntityProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify typed runtime behavior coverage; AetheriaUnityObservedEntityProjector.cs is missing.");
|
||||
var runtimeRestoreSource = actionGameManager + "\n" + observedEntityProjector;
|
||||
|
||||
var requiredFactoryMappings = new[]
|
||||
{
|
||||
|
|
@ -4769,8 +4769,8 @@ static void RequireRuntimeMenuTabsUseEveSurface(string root)
|
|||
"TryResolveDockedLocalStory(out _currentLocation)",
|
||||
"private bool TryResolveDockingState(out AetheriaClientDockingSnapshot dockingState)",
|
||||
"private bool TryResolveDockedLocalStory(out LocationStory story)",
|
||||
"SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)",
|
||||
"_observedFacadeIndex.TryResolveDockingBayByRecordKey(",
|
||||
"SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)",
|
||||
"_observedEntityIndex.TryResolveDockingBayByRecordKey(",
|
||||
"dockingState.DockParentEntityKey",
|
||||
"dockingState.DockingBayIndex",
|
||||
"dockingBay?.Entity is not OrbitalEntity { Story: { } dockedStory }",
|
||||
|
|
@ -4893,7 +4893,7 @@ static void RequireInventoryShipSettingsUseEveSurface(string root)
|
|||
"ResolveDefaultShutdownPerformance()",
|
||||
"ResolvePlayerSettings()?.DefaultShutdownPerformance",
|
||||
"TryResolveCurrentEntityDocument(out var currentEntity)",
|
||||
"SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)",
|
||||
"SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)",
|
||||
"private AetheriaRuntimeCurrentEntityDocument _shipSettingsCurrentEntity;",
|
||||
"!TryResolveCurrentEntityDocument(out var latestCurrentEntity)",
|
||||
"RequestEntityShutdownPerformance(",
|
||||
|
|
@ -6166,8 +6166,8 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"_displayedEntityKey",
|
||||
"_displayedCargoEntityKey",
|
||||
"TryResolveStationRefitEntity(string entityKey",
|
||||
"SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)",
|
||||
"_observedFacadeIndex.TryResolveEntityByRecordKey",
|
||||
"SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)",
|
||||
"_observedEntityIndex.TryResolveEntityByRecordKey",
|
||||
"TryResolveObservedDockingIndex(out var dockingIndex)",
|
||||
"dockingIndex.TryResolveCurrentDockingBay(out var resolvedDockingBay)",
|
||||
".DockingState",
|
||||
|
|
@ -6250,7 +6250,7 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
inventoryMenu.Contains("TryGetTypedCurrentDockingBayFacade", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("TryResolveCurrentEntityFacade", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("ResolveDockingState()?.CurrentDocking", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("_observedFacadeIndex.TryResolveDockingBayByRecordKey", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("_observedEntityIndex.TryResolveDockingBayByRecordKey", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("GameManager.TryGetObservedDockingBay(", StringComparison.Ordinal) ||
|
||||
inventoryMenu.Contains("GameManager.DockingBay", StringComparison.Ordinal))
|
||||
{
|
||||
|
|
@ -10061,10 +10061,10 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
var daemonEntitySnapshotProjector = File.Exists(daemonEntitySnapshotProjectorPath)
|
||||
? File.ReadAllText(daemonEntitySnapshotProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Continue entity projection; AetheriaUnityDaemonEntitySnapshotProjector.cs is missing.");
|
||||
var observedFacadeProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedFacadeProjector.cs");
|
||||
var observedFacadeProjector = File.Exists(observedFacadeProjectorPath)
|
||||
? File.ReadAllText(observedFacadeProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Continue facade projection; AetheriaUnityObservedFacadeProjector.cs is missing.");
|
||||
var observedEntityProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedEntityProjector.cs");
|
||||
var observedEntityProjector = File.Exists(observedEntityProjectorPath)
|
||||
? File.ReadAllText(observedEntityProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Continue entity projection; AetheriaUnityObservedEntityProjector.cs is missing.");
|
||||
var entityConstructionBlueprintProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityEntityConstructionBlueprintProjector.cs");
|
||||
var entityConstructionBlueprintProjector = File.Exists(entityConstructionBlueprintProjectorPath)
|
||||
? File.ReadAllText(entityConstructionBlueprintProjectorPath)
|
||||
|
|
@ -10119,7 +10119,7 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"private AetheriaUnityObservedTargetQuery ObservedTargetQuery =>",
|
||||
"ResolveObservedTarget = entity => ObservedTargetQuery.GetObservedTarget(entity)",
|
||||
"TargetPresentation = _targetPresentation",
|
||||
"private readonly AetheriaUnityObservedFacadeIndex _observedFacadeIndex",
|
||||
"private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex",
|
||||
"private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>",
|
||||
"EntityConstructionBlueprintProjector.ProjectObservedEntity",
|
||||
"_loadoutItemProjector.CreateLoadoutItem",
|
||||
|
|
@ -10203,9 +10203,9 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
string.Join(", ", managerSnapshotProjectionHits));
|
||||
}
|
||||
|
||||
var requiredObservedFacadeProjectorSymbols = new[]
|
||||
var requiredObservedEntityProjectorSymbols = new[]
|
||||
{
|
||||
"public sealed class AetheriaUnityObservedFacadeProjector",
|
||||
"public sealed class AetheriaUnityObservedEntityProjector",
|
||||
"public bool TryApplyInPlace(",
|
||||
"public void Replace(",
|
||||
"EntityConstructionBlueprintProjector.ProjectObservedFromBlueprint(_itemManager, zone, blueprint)",
|
||||
|
|
@ -10213,28 +10213,28 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"entity.RestoreThermalExposure((float)entitySnapshot.Heatstroke, (float)entitySnapshot.Hypothermia)",
|
||||
"RestoreActiveConsumables(entity, entitySnapshot)",
|
||||
"RestoreRuntimeBehaviorState(entity, entitySnapshot, restoredEntities)",
|
||||
"_facadeIndex.EntitiesByRecordKey",
|
||||
"_entityIndex.EntitiesByRecordKey",
|
||||
"ResolveRuntimeBehavior(entity, weaponState.OwnerKind, weaponState.OwnerIndex, weaponState.BehaviorIndex)",
|
||||
"lockWeapon.RestoreRuntimeState(",
|
||||
"drive.RestoreRuntimeState(",
|
||||
"resourceScanner.RestoreRuntimeState(",
|
||||
"_facadeIndex.RefreshDaemonIndex();"
|
||||
"_entityIndex.RefreshDaemonIndex();"
|
||||
};
|
||||
var missingObservedFacadeProjectorSymbols = requiredObservedFacadeProjectorSymbols
|
||||
.Where(symbol => !observedFacadeProjector.Contains(symbol, StringComparison.Ordinal))
|
||||
var missingObservedEntityProjectorSymbols = requiredObservedEntityProjectorSymbols
|
||||
.Where(symbol => !observedEntityProjector.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (missingObservedFacadeProjectorSymbols.Length > 0)
|
||||
if (missingObservedEntityProjectorSymbols.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Observed Unity facade mutation/restoration must live in AetheriaUnityObservedFacadeProjector instead of ActionGameManager: " +
|
||||
string.Join(", ", missingObservedFacadeProjectorSymbols));
|
||||
"Observed Unity entity mutation/restoration must live in AetheriaUnityObservedEntityProjector instead of ActionGameManager: " +
|
||||
string.Join(", ", missingObservedEntityProjectorSymbols));
|
||||
}
|
||||
|
||||
var forbiddenManagerFacadeProjectionSymbols = new[]
|
||||
{
|
||||
"private bool CanApplyDaemonEntitySnapshotsInPlace(",
|
||||
"private void ApplyDaemonEntitySnapshotsInPlace(",
|
||||
"private void ReplaceObservedEntityFacadesFromTypedSnapshots(",
|
||||
"private void ReplaceObservedEntitySnapshotsFromTypedSnapshots(",
|
||||
"private void RestoreActiveConsumablesFromTypedEntitySnapshot(",
|
||||
"private void RestoreRuntimeBehaviorStateFromTypedSnapshot(",
|
||||
"private static Behavior ResolveRuntimeBehavior(",
|
||||
|
|
@ -10250,7 +10250,7 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
if (managerFacadeProjectionHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ActionGameManager still owns observed facade mutation/restoration internals: " +
|
||||
"ActionGameManager still owns observed entity mutation/restoration internals: " +
|
||||
string.Join(", ", managerFacadeProjectionHits));
|
||||
}
|
||||
|
||||
|
|
@ -10358,16 +10358,16 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"private bool TryRestoreEntityGraphFromZoneRender(",
|
||||
"if (string.IsNullOrWhiteSpace(render.RunId))",
|
||||
"Aetheria zone-render feed does not identify a run id.",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntityFacades)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntitySnapshots)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.EntityIndexFromRecordKey(entity.RecordKey)",
|
||||
"_facadeProjector.TryApplyInPlace(",
|
||||
"_entityProjector.TryApplyInPlace(",
|
||||
"zoneRenderer?.ApplyZoneRender(render)",
|
||||
"_zoneContextProjector.ResolveContext(targetZone, render)",
|
||||
"_facadeProjector.Replace(entitySnapshots, currentEntityKey, _getZone())",
|
||||
"_entityProjector.Replace(entitySnapshots, currentEntityKey, _getZone())",
|
||||
"_restoreCurrentEntityBinding(currentEntity)",
|
||||
"_facadeIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity)",
|
||||
"_facadeIndex.EntitiesByDaemonIndex",
|
||||
"zoneRenderer?.LoadDaemonZoneView(_facadeIndex.EntitiesByDaemonIndex, render)",
|
||||
"_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity)",
|
||||
"_entityIndex.EntitiesByDaemonIndex",
|
||||
"zoneRenderer?.LoadDaemonZoneView(_entityIndex.EntitiesByDaemonIndex, render)",
|
||||
"zoneRenderer?.RestoreDroppedPickupsFromZoneRender(render)"
|
||||
};
|
||||
var missingObservedFrameApplierSymbols = requiredObservedFrameApplierSymbols
|
||||
|
|
@ -10389,9 +10389,9 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"private bool TryRestoreEntityGraphFromZoneRender(",
|
||||
"AetheriaRuntimeRtsProjection.ProjectZoneRender(observed.Frame)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, daemonZone)",
|
||||
"ObservedFacadeProjector.TryApplyInPlace(",
|
||||
"ObservedFacadeProjector.Replace(entitySnapshots, currentEntityKey, Zone)",
|
||||
"ZoneRenderer?.LoadDaemonZoneView(_observedFacadeIndex.EntitiesByDaemonIndex, render)",
|
||||
"ObservedEntityProjector.TryApplyInPlace(",
|
||||
"ObservedEntityProjector.Replace(entitySnapshots, currentEntityKey, Zone)",
|
||||
"ZoneRenderer?.LoadDaemonZoneView(_observedEntityIndex.EntitiesByDaemonIndex, render)",
|
||||
"ZoneRenderer?.RestoreDroppedPickupsFromDaemonZoneState(daemonZone)",
|
||||
"render.ActionBarBindings",
|
||||
"private static AetheriaRuntimeActionBarBindingSnapshot ToActionBarBindingSnapshot("
|
||||
|
|
@ -10420,7 +10420,7 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
".Aetheria()",
|
||||
".ZoneContacts",
|
||||
".LatestAsync()",
|
||||
"_facadeIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity)"
|
||||
"_entityIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity)"
|
||||
};
|
||||
var missingObservedTargetQuerySymbols = requiredObservedTargetQuerySymbols
|
||||
.Where(symbol => !observedTargetQuery.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -10461,7 +10461,7 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"public bool IsEntityUndocked(Entity entity)",
|
||||
"public bool TryResolveDockingBay(",
|
||||
"out AetheriaRuntimeCurrentDockingDocument docking",
|
||||
"_observedFacadeIndex.TryResolveEntityByRecordKey(docking.DockParentEntityKey",
|
||||
"_observedEntityIndex.TryResolveEntityByRecordKey(docking.DockParentEntityKey",
|
||||
"docking.DockingBayIndex"
|
||||
};
|
||||
var missingObservedDockingSymbols = requiredObservedDockingSymbols
|
||||
|
|
@ -10952,7 +10952,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
var observedTargetQueryPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedTargetQuery.cs");
|
||||
var observedFrameApplierPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedFrameApplier.cs");
|
||||
var daemonEntitySnapshotProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityDaemonEntitySnapshotProjector.cs");
|
||||
var observedFacadeProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedFacadeProjector.cs");
|
||||
var observedEntityProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedEntityProjector.cs");
|
||||
var entityConstructionBlueprintProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityEntityConstructionBlueprintProjector.cs");
|
||||
var observedZoneContextProjectorPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedZoneContextProjector.cs");
|
||||
var currentEntityBinderPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityCurrentEntityBinder.cs");
|
||||
|
|
@ -11001,9 +11001,9 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
var daemonEntitySnapshotProjector = File.Exists(daemonEntitySnapshotProjectorPath)
|
||||
? File.ReadAllText(daemonEntitySnapshotProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Unity observer authority; AetheriaUnityDaemonEntitySnapshotProjector.cs is missing.");
|
||||
var observedFacadeProjector = File.Exists(observedFacadeProjectorPath)
|
||||
? File.ReadAllText(observedFacadeProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Unity observer authority; AetheriaUnityObservedFacadeProjector.cs is missing.");
|
||||
var observedEntityProjector = File.Exists(observedEntityProjectorPath)
|
||||
? File.ReadAllText(observedEntityProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Unity observer authority; AetheriaUnityObservedEntityProjector.cs is missing.");
|
||||
var entityConstructionBlueprintProjector = File.Exists(entityConstructionBlueprintProjectorPath)
|
||||
? File.ReadAllText(entityConstructionBlueprintProjectorPath)
|
||||
: throw new InvalidOperationException("Cannot verify Unity observer authority; AetheriaUnityEntityConstructionBlueprintProjector.cs is missing.");
|
||||
|
|
@ -11136,13 +11136,13 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
"Unity observer entity projection no longer flows through the dedicated daemon snapshot projector.");
|
||||
}
|
||||
|
||||
if (!observedFacadeProjector.Contains("public bool TryApplyInPlace(", StringComparison.Ordinal) ||
|
||||
!observedFacadeProjector.Contains("public void Replace(", StringComparison.Ordinal) ||
|
||||
!observedFacadeProjector.Contains("EntityConstructionBlueprintProjector.ProjectObservedFromBlueprint(_itemManager, zone, blueprint)", StringComparison.Ordinal) ||
|
||||
!observedFacadeProjector.Contains("RestoreRuntimeBehaviorState(entity, entitySnapshot, restoredEntities)", StringComparison.Ordinal))
|
||||
if (!observedEntityProjector.Contains("public bool TryApplyInPlace(", StringComparison.Ordinal) ||
|
||||
!observedEntityProjector.Contains("public void Replace(", StringComparison.Ordinal) ||
|
||||
!observedEntityProjector.Contains("EntityConstructionBlueprintProjector.ProjectObservedFromBlueprint(_itemManager, zone, blueprint)", StringComparison.Ordinal) ||
|
||||
!observedEntityProjector.Contains("RestoreRuntimeBehaviorState(entity, entitySnapshot, restoredEntities)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Unity observer facade restoration no longer flows through the dedicated observed facade projector.");
|
||||
"Unity observer facade restoration no longer flows through the dedicated observed entity projector.");
|
||||
}
|
||||
|
||||
var requiredEntityConstructionBlueprintProjectorSymbols = new[]
|
||||
|
|
@ -11213,14 +11213,14 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
".ZoneRender",
|
||||
".LatestAsync()",
|
||||
"private bool TryRestoreEntityGraphFromZoneRender(",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntityFacades)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntitySnapshots)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.EntityIndexFromRecordKey(entity.RecordKey)",
|
||||
"_facadeProjector.Replace(entitySnapshots, currentEntityKey, _getZone())",
|
||||
"_facadeProjector.TryApplyInPlace(",
|
||||
"_facadeIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity)",
|
||||
"_facadeIndex.EntitiesByDaemonIndex",
|
||||
"_entityProjector.Replace(entitySnapshots, currentEntityKey, _getZone())",
|
||||
"_entityProjector.TryApplyInPlace(",
|
||||
"_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity)",
|
||||
"_entityIndex.EntitiesByDaemonIndex",
|
||||
"_zoneContextProjector.ResolveContext(targetZone, render)",
|
||||
"zoneRenderer?.LoadDaemonZoneView(_facadeIndex.EntitiesByDaemonIndex, render)",
|
||||
"zoneRenderer?.LoadDaemonZoneView(_entityIndex.EntitiesByDaemonIndex, render)",
|
||||
"zoneRenderer?.ApplyZoneRender(render)",
|
||||
"zoneRenderer?.RestoreDroppedPickupsFromZoneRender(render)",
|
||||
"_restoreCurrentEntityBinding(currentEntity)"
|
||||
|
|
@ -11244,9 +11244,9 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
"private bool TryRestoreEntityGraphFromZoneRender(",
|
||||
"AetheriaRuntimeRtsProjection.ProjectZoneRender(observed.Frame)",
|
||||
"AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, daemonZone)",
|
||||
"ObservedFacadeProjector.Replace(entitySnapshots, currentEntityKey, Zone)",
|
||||
"ObservedFacadeProjector.TryApplyInPlace(",
|
||||
"ZoneRenderer?.LoadDaemonZoneView(_observedFacadeIndex.EntitiesByDaemonIndex, render)",
|
||||
"ObservedEntityProjector.Replace(entitySnapshots, currentEntityKey, Zone)",
|
||||
"ObservedEntityProjector.TryApplyInPlace(",
|
||||
"ZoneRenderer?.LoadDaemonZoneView(_observedEntityIndex.EntitiesByDaemonIndex, render)",
|
||||
"ZoneRenderer?.ApplyZoneRender(render)",
|
||||
"ZoneRenderer?.RestoreDroppedPickupsFromDaemonZoneState(daemonZone)",
|
||||
"render.ActionBarBindings",
|
||||
|
|
@ -11315,7 +11315,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
"public void RequestTargetReticle()",
|
||||
"public void RequestDock()",
|
||||
"public void RequestUndock()",
|
||||
"_observedFacadeIndex.TryResolveEntityRecordKey(target, out var targetEntityKey)",
|
||||
"_observedEntityIndex.TryResolveEntityRecordKey(target, out var targetEntityKey)",
|
||||
"Submit(operations => operations.Interact(), \"interact\")",
|
||||
"Submit(operations => operations.ClearTarget(), \"target clear\")",
|
||||
"operations => operations.SetTarget(targetEntityKey)",
|
||||
|
|
@ -11382,7 +11382,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
".Aetheria()",
|
||||
".ZoneContacts",
|
||||
".LatestAsync()",
|
||||
"_facadeIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity)"
|
||||
"_entityIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity)"
|
||||
};
|
||||
var missingObservedTargetQuerySymbols = requiredObservedTargetQuerySymbols
|
||||
.Where(symbol => !observedTargetQuery.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaDaemonObserver _daemonObserver;
|
||||
private AetheriaUnityPilotCommandSender _pilotCommands;
|
||||
private AetheriaUnityObservedDockingIndex _observedDocking;
|
||||
private AetheriaUnityObservedFacadeProjector _observedFacadeProjector;
|
||||
private AetheriaUnityObservedEntityProjector _observedEntityProjector;
|
||||
private AetheriaUnityCurrentEntityBinder _currentEntityBinder;
|
||||
private AetheriaUnityObservedZoneContextProjector _observedZoneContextProjector;
|
||||
private AetheriaUnityPilotFrameAdapter _pilotFrameAdapter;
|
||||
|
|
@ -37,10 +37,10 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityObservedDockingIndex ObservedDocking =>
|
||||
_observedDocking ??= new AetheriaUnityObservedDockingIndex(
|
||||
() => ResolveDaemonObserver()?.Client,
|
||||
_observedFacadeIndex);
|
||||
private AetheriaUnityObservedFacadeProjector ObservedFacadeProjector =>
|
||||
_observedFacadeProjector ??= new AetheriaUnityObservedFacadeProjector(
|
||||
_observedFacadeIndex,
|
||||
_observedEntityIndex);
|
||||
private AetheriaUnityObservedEntityProjector ObservedEntityProjector =>
|
||||
_observedEntityProjector ??= new AetheriaUnityObservedEntityProjector(
|
||||
_observedEntityIndex,
|
||||
ItemManager,
|
||||
EntityConstructionBlueprintProjector.ProjectObservedEntity,
|
||||
_loadoutItemProjector.CreateLoadoutItem,
|
||||
|
|
@ -92,21 +92,21 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityPilotOperationAdapter PilotOperationAdapter =>
|
||||
_pilotOperationAdapter ??= new AetheriaUnityPilotOperationAdapter(
|
||||
() => PilotCommands,
|
||||
_observedFacadeIndex,
|
||||
_observedEntityIndex,
|
||||
() => _viewDirection,
|
||||
() => CurrentEntity);
|
||||
private AetheriaUnityObservedTargetQuery ObservedTargetQuery =>
|
||||
_observedTargetQuery ??= new AetheriaUnityObservedTargetQuery(
|
||||
() => ResolveDaemonObserver()?.Client,
|
||||
_observedFacadeIndex);
|
||||
_observedEntityIndex);
|
||||
private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>
|
||||
_observedFrameApplier ??= new AetheriaUnityObservedFrameApplier(
|
||||
ResolveDaemonObserver,
|
||||
AetheriaUnityObservedRunProjection.FindZone,
|
||||
() => Zone,
|
||||
zone => Zone = zone,
|
||||
_observedFacadeIndex,
|
||||
ObservedFacadeProjector,
|
||||
_observedEntityIndex,
|
||||
ObservedEntityProjector,
|
||||
ObservedZoneContextProjector,
|
||||
() => ZoneRenderer,
|
||||
() => CurrentEntity,
|
||||
|
|
@ -217,7 +217,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
TargetShieldsFill = TargetShieldsFill,
|
||||
MainMenu = MainMenu
|
||||
};
|
||||
private readonly AetheriaUnityObservedFacadeIndex _observedFacadeIndex = new AetheriaUnityObservedFacadeIndex();
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex = new AetheriaUnityObservedEntityIndex();
|
||||
private static RuntimePlayerSettings RuntimePlayerSettings
|
||||
=> AetheriaUnityRuntimeClientProvider.PlayerSettings;
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
SceneWiring.ConfigureTargetPresentation(
|
||||
_targetPresentation,
|
||||
boot.RuntimeCatalog,
|
||||
_observedFacadeIndex,
|
||||
_observedEntityIndex,
|
||||
ObservedTargetQuery,
|
||||
() => ResolveDaemonObserver()?.Client);
|
||||
SceneWiring.ConfigureInventoryDragSession(_dragSession);
|
||||
|
|
@ -341,7 +341,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
() => CurrentEntity,
|
||||
ResolveActionBarClient);
|
||||
SceneWiring.ConfigureRuntimeInputScreenShell(MenuShell);
|
||||
SceneWiring.ConfigureObservedFacadeIndex(_observedFacadeIndex);
|
||||
SceneWiring.ConfigureObservedEntityIndex(_observedEntityIndex);
|
||||
|
||||
// TODO: Process Stories
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
public void ConfigureTargetPresentation(
|
||||
AetheriaUnityTargetPresentation presentation,
|
||||
AetheriaRuntimeCatalogSnapshot runtimeCatalog,
|
||||
AetheriaUnityObservedFacadeIndex observedFacadeIndex,
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex,
|
||||
AetheriaUnityObservedTargetQuery observedTargetQuery,
|
||||
Func<AetheriaClient> resolveClient)
|
||||
{
|
||||
|
|
@ -97,8 +97,8 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
presentation.TargetShieldsFill = TargetShieldsFill;
|
||||
presentation.ResolveClient = resolveClient;
|
||||
presentation.ResolveEntity = daemonEntityIndex =>
|
||||
observedFacadeIndex != null &&
|
||||
observedFacadeIndex.TryResolveEntityByDaemonIndex(daemonEntityIndex, out var entity)
|
||||
observedEntityIndex != null &&
|
||||
observedEntityIndex.TryResolveEntityByDaemonIndex(daemonEntityIndex, out var entity)
|
||||
? entity
|
||||
: null;
|
||||
presentation.ResolveTarget = observedTargetQuery.GetObservedTarget;
|
||||
|
|
@ -136,12 +136,12 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
MainMenu?.SetRuntimeInputScreenShell(menuShell.CanOpenRuntimeInputScreen, menuShell.ShowRuntimeInputScreen);
|
||||
}
|
||||
|
||||
public void ConfigureObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)
|
||||
public void ConfigureObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
Inventory?.SetObservedFacadeIndex(observedFacadeIndex);
|
||||
ShipPanel?.SetObservedFacadeIndex(observedFacadeIndex);
|
||||
TargetShipPanel?.SetObservedFacadeIndex(observedFacadeIndex);
|
||||
Inventory?.SetObservedEntityIndex(observedEntityIndex);
|
||||
ShipPanel?.SetObservedEntityIndex(observedEntityIndex);
|
||||
TargetShipPanel?.SetObservedEntityIndex(observedEntityIndex);
|
||||
foreach (var localMenu in UnityEngine.Object.FindObjectsByType<LocalMenu>(FindObjectsSortMode.None))
|
||||
localMenu.SetObservedFacadeIndex(observedFacadeIndex);
|
||||
localMenu.SetObservedEntityIndex(observedEntityIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ using GameCult.Aetheria.State.Verse;
|
|||
public sealed class AetheriaUnityObservedDockingIndex
|
||||
{
|
||||
private readonly Func<AetheriaClient> _resolveClient;
|
||||
private readonly AetheriaUnityObservedFacadeIndex _observedFacadeIndex;
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
|
||||
public AetheriaUnityObservedDockingIndex(
|
||||
Func<AetheriaClient> resolveClient,
|
||||
AetheriaUnityObservedFacadeIndex observedFacadeIndex)
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
_resolveClient = resolveClient ?? throw new ArgumentNullException(nameof(resolveClient));
|
||||
_observedFacadeIndex = observedFacadeIndex ?? throw new ArgumentNullException(nameof(observedFacadeIndex));
|
||||
_observedEntityIndex = observedEntityIndex ?? throw new ArgumentNullException(nameof(observedEntityIndex));
|
||||
}
|
||||
|
||||
public int ResolveEntityZoneIndex(Entity entity)
|
||||
|
|
@ -36,7 +36,7 @@ public sealed class AetheriaUnityObservedDockingIndex
|
|||
entity = null;
|
||||
return TryResolveCurrentDockingSnapshot(out var snapshot) &&
|
||||
!string.IsNullOrWhiteSpace(snapshot.CurrentEntityKey) &&
|
||||
_observedFacadeIndex.TryResolveEntityByRecordKey(snapshot.CurrentEntityKey, out entity);
|
||||
_observedEntityIndex.TryResolveEntityByRecordKey(snapshot.CurrentEntityKey, out entity);
|
||||
}
|
||||
|
||||
public bool TryResolveCurrentEntityKey(out string currentEntityKey)
|
||||
|
|
@ -77,7 +77,7 @@ public sealed class AetheriaUnityObservedDockingIndex
|
|||
snapshot.CurrentDockingBay == null ||
|
||||
string.IsNullOrWhiteSpace(snapshot.DockParentEntityKey) ||
|
||||
snapshot.DockingBayIndex < 0 ||
|
||||
!_observedFacadeIndex.TryResolveDockingBayByRecordKey(
|
||||
!_observedEntityIndex.TryResolveDockingBayByRecordKey(
|
||||
snapshot.DockParentEntityKey,
|
||||
snapshot.DockingBayIndex,
|
||||
out dockingBay))
|
||||
|
|
@ -116,7 +116,7 @@ public sealed class AetheriaUnityObservedDockingIndex
|
|||
if (!TryResolveCurrentDocking(child, out docking) || !docking.IsDocked)
|
||||
return false;
|
||||
|
||||
if (!_observedFacadeIndex.TryResolveEntityByRecordKey(docking.DockParentEntityKey, out var parent) ||
|
||||
if (!_observedEntityIndex.TryResolveEntityByRecordKey(docking.DockParentEntityKey, out var parent) ||
|
||||
!(parent is OrbitalEntity))
|
||||
{
|
||||
return false;
|
||||
|
|
@ -148,7 +148,7 @@ public sealed class AetheriaUnityObservedDockingIndex
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_observedFacadeIndex.TryResolveEntityRecordKey(entity, out var entityKey) &&
|
||||
if (_observedEntityIndex.TryResolveEntityRecordKey(entity, out var entityKey) &&
|
||||
!string.IsNullOrWhiteSpace(docking.CurrentEntityKey) &&
|
||||
!string.Equals(docking.CurrentEntityKey, entityKey, StringComparison.Ordinal))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public sealed class AetheriaUnityObservedFacadeIndex
|
||||
public sealed class AetheriaUnityObservedEntityIndex
|
||||
{
|
||||
private readonly Dictionary<string, Entity> _entitiesByRecordKey = new Dictionary<string, Entity>(StringComparer.Ordinal);
|
||||
private readonly Dictionary<int, Entity> _entitiesByDaemonIndex = new Dictionary<int, Entity>();
|
||||
|
|
@ -6,22 +6,22 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
|
||||
public sealed class AetheriaUnityObservedFacadeProjector
|
||||
public sealed class AetheriaUnityObservedEntityProjector
|
||||
{
|
||||
private readonly AetheriaUnityObservedFacadeIndex _facadeIndex;
|
||||
private readonly AetheriaUnityObservedEntityIndex _entityIndex;
|
||||
private readonly ItemManager _itemManager;
|
||||
private readonly Func<AetheriaRuntimeEntitySnapshot, bool, EntityConstructionBlueprint> _createBlueprint;
|
||||
private readonly Func<AetheriaRuntimeLoadoutItemSnapshot, ItemInstance> _createLoadoutItem;
|
||||
private readonly Action<string> _logWarning;
|
||||
|
||||
public AetheriaUnityObservedFacadeProjector(
|
||||
AetheriaUnityObservedFacadeIndex facadeIndex,
|
||||
public AetheriaUnityObservedEntityProjector(
|
||||
AetheriaUnityObservedEntityIndex entityIndex,
|
||||
ItemManager itemManager,
|
||||
Func<AetheriaRuntimeEntitySnapshot, bool, EntityConstructionBlueprint> createBlueprint,
|
||||
Func<AetheriaRuntimeLoadoutItemSnapshot, ItemInstance> createLoadoutItem,
|
||||
Action<string> logWarning)
|
||||
{
|
||||
_facadeIndex = facadeIndex ?? throw new ArgumentNullException(nameof(facadeIndex));
|
||||
_entityIndex = entityIndex ?? throw new ArgumentNullException(nameof(entityIndex));
|
||||
_itemManager = itemManager ?? throw new ArgumentNullException(nameof(itemManager));
|
||||
_createBlueprint = createBlueprint ?? throw new ArgumentNullException(nameof(createBlueprint));
|
||||
_createLoadoutItem = createLoadoutItem ?? throw new ArgumentNullException(nameof(createLoadoutItem));
|
||||
|
|
@ -41,19 +41,19 @@ public sealed class AetheriaUnityObservedFacadeProjector
|
|||
reboundCurrentEntity = null;
|
||||
if (!string.Equals(lastRunId, runId, StringComparison.Ordinal) ||
|
||||
lastZoneIndex != zoneIndex ||
|
||||
_facadeIndex.Count != entitySnapshots.Count)
|
||||
_entityIndex.Count != entitySnapshots.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var snapshot in entitySnapshots)
|
||||
{
|
||||
if (!_facadeIndex.ContainsRecordKey(snapshot.RecordKey))
|
||||
if (!_entityIndex.ContainsRecordKey(snapshot.RecordKey))
|
||||
return false;
|
||||
}
|
||||
|
||||
ApplyInPlace(entitySnapshots);
|
||||
if (_facadeIndex.TryResolveEntityByRecordKey(currentEntityKey, out var resolvedCurrentEntity) &&
|
||||
if (_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var resolvedCurrentEntity) &&
|
||||
currentEntity != resolvedCurrentEntity)
|
||||
{
|
||||
reboundCurrentEntity = resolvedCurrentEntity;
|
||||
|
|
@ -100,14 +100,14 @@ public sealed class AetheriaUnityObservedFacadeProjector
|
|||
RestoreRuntimeBehaviorState(entity, entitySnapshot, restoredEntities);
|
||||
}
|
||||
|
||||
_facadeIndex.Replace(restoredEntities);
|
||||
_entityIndex.Replace(restoredEntities);
|
||||
}
|
||||
|
||||
private void ApplyInPlace(IReadOnlyList<AetheriaRuntimeEntitySnapshot> entitySnapshots)
|
||||
{
|
||||
foreach (var entitySnapshot in entitySnapshots)
|
||||
{
|
||||
if (!_facadeIndex.TryResolveEntityByRecordKey(entitySnapshot.RecordKey, out var entity))
|
||||
if (!_entityIndex.TryResolveEntityByRecordKey(entitySnapshot.RecordKey, out var entity))
|
||||
continue;
|
||||
|
||||
ApplyPoseAndSimpleRuntimeState(entity, entitySnapshot);
|
||||
|
|
@ -115,10 +115,10 @@ public sealed class AetheriaUnityObservedFacadeProjector
|
|||
if (entity.Settings != null)
|
||||
entity.Settings.ShutdownPerformance = (float)entitySnapshot.ShutdownPerformance;
|
||||
entity.RestoreThermalExposure((float)entitySnapshot.Heatstroke, (float)entitySnapshot.Hypothermia);
|
||||
RestoreRuntimeBehaviorState(entity, entitySnapshot, _facadeIndex.EntitiesByRecordKey);
|
||||
RestoreRuntimeBehaviorState(entity, entitySnapshot, _entityIndex.EntitiesByRecordKey);
|
||||
}
|
||||
|
||||
_facadeIndex.RefreshDaemonIndex();
|
||||
_entityIndex.RefreshDaemonIndex();
|
||||
}
|
||||
|
||||
private static void ApplyPoseAndSimpleRuntimeState(Entity entity, AetheriaRuntimeEntitySnapshot entitySnapshot)
|
||||
|
|
@ -13,8 +13,8 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
private readonly Func<int, GalaxyZone> _resolveObservedZone;
|
||||
private readonly Func<Zone> _getZone;
|
||||
private readonly Action<Zone> _setZone;
|
||||
private readonly AetheriaUnityObservedFacadeIndex _facadeIndex;
|
||||
private readonly AetheriaUnityObservedFacadeProjector _facadeProjector;
|
||||
private readonly AetheriaUnityObservedEntityIndex _entityIndex;
|
||||
private readonly AetheriaUnityObservedEntityProjector _entityProjector;
|
||||
private readonly AetheriaUnityObservedZoneContextProjector _zoneContextProjector;
|
||||
private readonly Func<ZoneRenderer> _resolveZoneRenderer;
|
||||
private readonly Func<Entity> _getCurrentEntity;
|
||||
|
|
@ -31,8 +31,8 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
Func<int, GalaxyZone> resolveObservedZone,
|
||||
Func<Zone> getZone,
|
||||
Action<Zone> setZone,
|
||||
AetheriaUnityObservedFacadeIndex facadeIndex,
|
||||
AetheriaUnityObservedFacadeProjector facadeProjector,
|
||||
AetheriaUnityObservedEntityIndex entityIndex,
|
||||
AetheriaUnityObservedEntityProjector entityProjector,
|
||||
AetheriaUnityObservedZoneContextProjector zoneContextProjector,
|
||||
Func<ZoneRenderer> resolveZoneRenderer,
|
||||
Func<Entity> getCurrentEntity,
|
||||
|
|
@ -43,8 +43,8 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
_resolveObservedZone = resolveObservedZone ?? (_ => null);
|
||||
_getZone = getZone ?? (() => null);
|
||||
_setZone = setZone ?? (_ => { });
|
||||
_facadeIndex = facadeIndex ?? throw new ArgumentNullException(nameof(facadeIndex));
|
||||
_facadeProjector = facadeProjector ?? throw new ArgumentNullException(nameof(facadeProjector));
|
||||
_entityIndex = entityIndex ?? throw new ArgumentNullException(nameof(entityIndex));
|
||||
_entityProjector = entityProjector ?? throw new ArgumentNullException(nameof(entityProjector));
|
||||
_zoneContextProjector = zoneContextProjector ?? throw new ArgumentNullException(nameof(zoneContextProjector));
|
||||
_resolveZoneRenderer = resolveZoneRenderer ?? (() => null);
|
||||
_getCurrentEntity = getCurrentEntity ?? (() => null);
|
||||
|
|
@ -108,13 +108,13 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
return false;
|
||||
}
|
||||
|
||||
var entitySnapshots = AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntityFacades)
|
||||
var entitySnapshots = AetheriaUnityDaemonEntitySnapshotProjector.CreateSnapshots(runId, render.ZoneIndex, render.EntitySnapshots)
|
||||
.OrderBy(entity => AetheriaUnityDaemonEntitySnapshotProjector.EntityIndexFromRecordKey(entity.RecordKey))
|
||||
.ToArray();
|
||||
|
||||
if (entitySnapshots.Length == 0)
|
||||
{
|
||||
_logWarning($"Aetheria zone-render feed has no entity facades for zone {render.ZoneIndex}.");
|
||||
_logWarning($"Aetheria zone-render feed has no entity snapshots for zone {render.ZoneIndex}.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
}
|
||||
|
||||
var zoneRenderer = _resolveZoneRenderer();
|
||||
if (_facadeProjector.TryApplyInPlace(
|
||||
if (_entityProjector.TryApplyInPlace(
|
||||
_lastAppliedZoneRenderRunId,
|
||||
_lastAppliedZoneRenderZoneIndex,
|
||||
runId,
|
||||
|
|
@ -161,9 +161,9 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
_setZone(resolvedZone);
|
||||
}
|
||||
|
||||
_facadeProjector.Replace(entitySnapshots, currentEntityKey, _getZone());
|
||||
zoneRenderer?.LoadDaemonZoneView(_facadeIndex.EntitiesByDaemonIndex, render);
|
||||
if (_facadeIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity))
|
||||
_entityProjector.Replace(entitySnapshots, currentEntityKey, _getZone());
|
||||
zoneRenderer?.LoadDaemonZoneView(_entityIndex.EntitiesByDaemonIndex, render);
|
||||
if (_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity))
|
||||
_restoreCurrentEntityBinding(currentEntity);
|
||||
zoneRenderer?.RestoreDroppedPickupsFromZoneRender(render);
|
||||
_lastAppliedZoneRenderFrameId = render.FrameId;
|
||||
|
|
|
|||
|
|
@ -9,20 +9,20 @@ using GameCult.Aetheria.State.Verse;
|
|||
public sealed class AetheriaUnityObservedTargetQuery
|
||||
{
|
||||
private readonly Func<AetheriaClient> _resolveClient;
|
||||
private readonly AetheriaUnityObservedFacadeIndex _facadeIndex;
|
||||
private readonly AetheriaUnityObservedEntityIndex _entityIndex;
|
||||
|
||||
public AetheriaUnityObservedTargetQuery(
|
||||
Func<AetheriaClient> resolveClient,
|
||||
AetheriaUnityObservedFacadeIndex facadeIndex)
|
||||
AetheriaUnityObservedEntityIndex entityIndex)
|
||||
{
|
||||
_resolveClient = resolveClient ?? (() => null);
|
||||
_facadeIndex = facadeIndex ?? throw new ArgumentNullException(nameof(facadeIndex));
|
||||
_entityIndex = entityIndex ?? throw new ArgumentNullException(nameof(entityIndex));
|
||||
}
|
||||
|
||||
public Entity GetObservedTarget(Entity observer)
|
||||
{
|
||||
if (TryQueryEntityTarget(observer, out var targetEntityIndex) &&
|
||||
_facadeIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity))
|
||||
_entityIndex.TryResolveEntityByDaemonIndex(targetEntityIndex, out var targetEntity))
|
||||
{
|
||||
return targetEntity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ using Unity.Mathematics;
|
|||
public sealed class AetheriaUnityPilotOperationAdapter
|
||||
{
|
||||
private readonly Func<AetheriaUnityPilotCommandSender> _resolvePilotCommands;
|
||||
private readonly AetheriaUnityObservedFacadeIndex _observedFacadeIndex;
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private readonly Func<float3> _resolveViewDirection;
|
||||
private readonly Func<Entity> _resolveCurrentEntity;
|
||||
|
||||
public AetheriaUnityPilotOperationAdapter(
|
||||
Func<AetheriaUnityPilotCommandSender> resolvePilotCommands,
|
||||
AetheriaUnityObservedFacadeIndex observedFacadeIndex,
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex,
|
||||
Func<float3> resolveViewDirection,
|
||||
Func<Entity> resolveCurrentEntity)
|
||||
{
|
||||
_resolvePilotCommands = resolvePilotCommands ?? throw new ArgumentNullException(nameof(resolvePilotCommands));
|
||||
_observedFacadeIndex = observedFacadeIndex ?? throw new ArgumentNullException(nameof(observedFacadeIndex));
|
||||
_observedEntityIndex = observedEntityIndex ?? throw new ArgumentNullException(nameof(observedEntityIndex));
|
||||
_resolveViewDirection = resolveViewDirection ?? (() => default);
|
||||
_resolveCurrentEntity = resolveCurrentEntity ?? (() => null);
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public sealed class AetheriaUnityPilotOperationAdapter
|
|||
return;
|
||||
}
|
||||
|
||||
if (!_observedFacadeIndex.TryResolveEntityRecordKey(target, out var targetEntityKey) ||
|
||||
if (!_observedEntityIndex.TryResolveEntityRecordKey(target, out var targetEntityKey) ||
|
||||
string.IsNullOrWhiteSpace(targetEntityKey))
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
private AetheriaRuntimeCatalogSnapshot _catalog;
|
||||
private AetheriaRuntimePlayerSettingsDocument _playerSettings;
|
||||
private AetheriaUnityActionBarPresentation _actionBarPresentation;
|
||||
private AetheriaUnityObservedFacadeIndex _observedFacadeIndex;
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _shipSettingsSurfaceChrome = PanelChrome(360f, 420f);
|
||||
private readonly AetheriaEveUnitySurfaceChrome _cargoItemDetailsSurfaceChrome = PanelChrome(420f, 520f);
|
||||
private readonly AetheriaEveUnitySurfaceChrome _equippedItemDetailsSurfaceChrome = PanelChrome(460f, 560f);
|
||||
|
|
@ -58,9 +58,9 @@ public class InventoryMenu : MonoBehaviour
|
|||
_actionBarPresentation = actionBarPresentation;
|
||||
}
|
||||
|
||||
public void SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
_observedFacadeIndex = observedFacadeIndex;
|
||||
_observedEntityIndex = observedEntityIndex;
|
||||
}
|
||||
// private int2 _dragCellOffset;
|
||||
// private ItemRotation _originalRotation;
|
||||
|
|
@ -704,8 +704,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
private bool TryResolveEntityRecordKey(Entity entity, out string recordKey)
|
||||
{
|
||||
recordKey = "";
|
||||
return _observedFacadeIndex != null &&
|
||||
_observedFacadeIndex.TryResolveEntityRecordKey(entity, out recordKey);
|
||||
return _observedEntityIndex != null &&
|
||||
_observedEntityIndex.TryResolveEntityRecordKey(entity, out recordKey);
|
||||
}
|
||||
|
||||
private bool IsCurrentEntity(Entity entity)
|
||||
|
|
@ -799,10 +799,10 @@ public class InventoryMenu : MonoBehaviour
|
|||
private bool TryResolveObservedDockingIndex(out AetheriaUnityObservedDockingIndex dockingIndex)
|
||||
{
|
||||
dockingIndex = null;
|
||||
if (_observedFacadeIndex == null)
|
||||
if (_observedEntityIndex == null)
|
||||
return false;
|
||||
|
||||
dockingIndex = new AetheriaUnityObservedDockingIndex(ResolveClient, _observedFacadeIndex);
|
||||
dockingIndex = new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
private Texture2D _temperatureTexture;
|
||||
private RectTransform _firstRect;
|
||||
private AetheriaUnityDragSession _dragSession;
|
||||
private AetheriaUnityObservedFacadeIndex _observedFacadeIndex;
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
|
||||
public ItemInstance FakeItem;
|
||||
public Shape FakeOccupancy;
|
||||
|
|
@ -85,9 +85,9 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
_dragSession = dragSession;
|
||||
}
|
||||
|
||||
public void SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
_observedFacadeIndex = observedFacadeIndex;
|
||||
_observedEntityIndex = observedEntityIndex;
|
||||
}
|
||||
|
||||
private AetheriaUnityDragSession DragSession => _dragSession ??= new AetheriaUnityDragSession();
|
||||
|
|
@ -1109,8 +1109,8 @@ private void Update()
|
|||
private bool TryResolveEntityRecordKey(Entity entity, out string recordKey)
|
||||
{
|
||||
recordKey = "";
|
||||
return _observedFacadeIndex != null &&
|
||||
_observedFacadeIndex.TryResolveEntityRecordKey(entity, out recordKey);
|
||||
return _observedEntityIndex != null &&
|
||||
_observedEntityIndex.TryResolveEntityRecordKey(entity, out recordKey);
|
||||
}
|
||||
|
||||
private bool IsCurrentEntity(Entity entity)
|
||||
|
|
@ -1178,10 +1178,10 @@ private void Update()
|
|||
private bool TryResolveObservedDockingIndex(out AetheriaUnityObservedDockingIndex dockingIndex)
|
||||
{
|
||||
dockingIndex = null;
|
||||
if (_observedFacadeIndex == null)
|
||||
if (_observedEntityIndex == null)
|
||||
return false;
|
||||
|
||||
dockingIndex = new AetheriaUnityObservedDockingIndex(ResolveClient, _observedFacadeIndex);
|
||||
dockingIndex = new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1201,10 +1201,10 @@ private void Update()
|
|||
private bool TryResolveObservedAvailableEntityByKey(string entityKey, out Entity entity)
|
||||
{
|
||||
entity = null;
|
||||
if (_observedFacadeIndex == null || string.IsNullOrWhiteSpace(entityKey))
|
||||
if (_observedEntityIndex == null || string.IsNullOrWhiteSpace(entityKey))
|
||||
return false;
|
||||
|
||||
return _observedFacadeIndex.TryResolveEntityByRecordKey(entityKey, out entity);
|
||||
return _observedEntityIndex.TryResolveEntityByRecordKey(entityKey, out entity);
|
||||
}
|
||||
|
||||
private bool IsDisplayedEntityKey(string entityKey)
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ public class LocalMenu : MonoBehaviour
|
|||
private readonly List<ActiveStoryChoice> _activeChoices = new List<ActiveStoryChoice>();
|
||||
private UIDocument _surfaceDocument;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _surfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private AetheriaUnityObservedFacadeIndex _observedFacadeIndex;
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
|
||||
public void SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
_observedFacadeIndex = observedFacadeIndex;
|
||||
_observedEntityIndex = observedEntityIndex;
|
||||
}
|
||||
|
||||
private sealed class ActiveStoryChoice
|
||||
|
|
@ -224,12 +224,12 @@ public class LocalMenu : MonoBehaviour
|
|||
private bool TryResolveDockedLocalStory(out LocationStory story)
|
||||
{
|
||||
story = null;
|
||||
if (_observedFacadeIndex == null ||
|
||||
if (_observedEntityIndex == null ||
|
||||
!TryResolveDockingState(out var dockingState) ||
|
||||
dockingState?.IsDocked != true ||
|
||||
string.IsNullOrWhiteSpace(dockingState.DockParentEntityKey) ||
|
||||
dockingState.DockingBayIndex < 0 ||
|
||||
!_observedFacadeIndex.TryResolveDockingBayByRecordKey(
|
||||
!_observedEntityIndex.TryResolveDockingBayByRecordKey(
|
||||
dockingState.DockParentEntityKey,
|
||||
dockingState.DockingBayIndex,
|
||||
out var dockingBay) ||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
new Dictionary<int, AetheriaRuntimeZoneTargetRow>();
|
||||
private readonly List<AetheriaRuntimeZoneContactRow> _daemonContactRows =
|
||||
new List<AetheriaRuntimeZoneContactRow>();
|
||||
private IReadOnlyDictionary<int, Entity> _observedEntityFacadesByDaemonIndex;
|
||||
private IReadOnlyDictionary<int, Entity> _observedEntitySnapshotsByDaemonIndex;
|
||||
private readonly List<int> _daemonPresentationEntityIndices = new List<int>();
|
||||
private readonly HashSet<int> _daemonPresentationEntityIndicesSet = new HashSet<int>();
|
||||
private readonly List<int> _daemonVisibleEntityIndices = new List<int>();
|
||||
|
|
@ -245,11 +245,11 @@ public class ZoneRenderer : MonoBehaviour
|
|||
}
|
||||
|
||||
public void LoadDaemonZoneView(
|
||||
IReadOnlyDictionary<int, Entity> observedEntityFacadesByDaemonIndex,
|
||||
IReadOnlyDictionary<int, Entity> observedEntitySnapshotsByDaemonIndex,
|
||||
AetheriaRuntimeZoneRenderDocument render)
|
||||
{
|
||||
ClearZone();
|
||||
_observedEntityFacadesByDaemonIndex = observedEntityFacadesByDaemonIndex;
|
||||
_observedEntitySnapshotsByDaemonIndex = observedEntitySnapshotsByDaemonIndex;
|
||||
ApplyZoneRender(render);
|
||||
RefreshDaemonVisibleEntityInstances();
|
||||
SyncDaemonEntityInstances();
|
||||
|
|
@ -918,8 +918,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
foreach (var entityIndex in _daemonPresentationEntityIndices)
|
||||
{
|
||||
if (_entityInstancesByDaemonIndex.ContainsKey(entityIndex) ||
|
||||
_observedEntityFacadesByDaemonIndex == null ||
|
||||
!_observedEntityFacadesByDaemonIndex.TryGetValue(entityIndex, out var entity))
|
||||
_observedEntitySnapshotsByDaemonIndex == null ||
|
||||
!_observedEntitySnapshotsByDaemonIndex.TryGetValue(entityIndex, out var entity))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -718,7 +718,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
.Where(pickup => pickup != null)
|
||||
.OrderBy(pickup => pickup.PickupIndex)
|
||||
.ToArray(),
|
||||
EntityFacades = (zone.Entities ?? Array.Empty<AetheriaRuntimeEntitySnapshotCommit>())
|
||||
EntitySnapshots = (zone.Entities ?? Array.Empty<AetheriaRuntimeEntitySnapshotCommit>())
|
||||
.Where(entity => entity != null)
|
||||
.OrderBy(entity => entity.EntityIndex)
|
||||
.ToArray(),
|
||||
|
|
|
|||
|
|
@ -868,7 +868,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Array.Empty<AetheriaRuntimeDroppedPickupCommit>();
|
||||
|
||||
[Key(17)]
|
||||
public IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> EntityFacades { get; set; } =
|
||||
public IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> EntitySnapshots { get; set; } =
|
||||
Array.Empty<AetheriaRuntimeEntitySnapshotCommit>();
|
||||
|
||||
[Key(18)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue