Remove observed run projection shim
This commit is contained in:
parent
e736a28bda
commit
d37826ea9a
6 changed files with 21 additions and 60 deletions
|
|
@ -11786,7 +11786,7 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>",
|
||||
"private Galaxy ObservedGalaxy { get; set; }",
|
||||
"ObservedGalaxy = boot.ObservedGalaxy",
|
||||
"zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex)",
|
||||
"ResolveObservedGalaxyZone",
|
||||
"private AetheriaUnityObservedZoneContextProjector ObservedZoneContextProjector =>",
|
||||
"entity => CurrentEntityBinder.RestoreBinding(entity)",
|
||||
"private AetheriaUnityObservedTargetQuery ObservedTargetQuery =>",
|
||||
|
|
@ -12767,7 +12767,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
|
|||
"private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>",
|
||||
"private Galaxy ObservedGalaxy { get; set; }",
|
||||
"ObservedGalaxy = boot.ObservedGalaxy",
|
||||
"zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex)",
|
||||
"ResolveObservedGalaxyZone",
|
||||
"private AetheriaUnityObservedZoneContextProjector ObservedZoneContextProjector =>",
|
||||
"entity => CurrentEntityBinder.RestoreBinding(entity)",
|
||||
"private AetheriaUnityEntityConstructionBlueprintProjector EntityConstructionBlueprintProjector =>",
|
||||
|
|
@ -15123,7 +15123,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"runtimeCatalogDocument.Current",
|
||||
".ReactiveSectorMap()",
|
||||
"sectorMapDocument.Current",
|
||||
"AetheriaUnityObservedRunProjection.Project(",
|
||||
"Galaxy.ProjectObservedSectorMap(",
|
||||
"sectorMap.IsTutorial",
|
||||
"sectorMap.GenerationSeed",
|
||||
"new AetheriaUnityGameplayBootResult(",
|
||||
|
|
@ -15140,31 +15140,10 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
}
|
||||
|
||||
var observedRunProjectionPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityObservedRunProjection.cs");
|
||||
var observedRunProjection = File.Exists(observedRunProjectionPath)
|
||||
? File.ReadAllText(observedRunProjectionPath)
|
||||
: throw new InvalidOperationException("Cannot verify observed run projection ownership; AetheriaUnityObservedRunProjection.cs is missing.");
|
||||
if (observedRunProjection.Contains("public static Galaxy Galaxy", StringComparison.Ordinal) ||
|
||||
observedRunProjection.Contains("private set;", StringComparison.Ordinal))
|
||||
if (File.Exists(observedRunProjectionPath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"AetheriaUnityObservedRunProjection must be a pure projector; observed galaxy ownership belongs to gameplay boot state.");
|
||||
}
|
||||
|
||||
var forbiddenObservedRunProjectionSymbols = new[]
|
||||
{
|
||||
"AetheriaRuntimeDaemonFrameDocument",
|
||||
"AetheriaRuntimeRunCheckpointCommit",
|
||||
"ProjectObservedDaemonRun",
|
||||
"FindZoneSnapshot"
|
||||
};
|
||||
var observedRunProjectionHits = forbiddenObservedRunProjectionSymbols
|
||||
.Where(symbol => observedRunProjection.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (observedRunProjectionHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"AetheriaUnityObservedRunProjection still accepts daemon-frame/run-checkpoint inputs; gameplay boot must use the managed sector-map document: " +
|
||||
string.Join(", ", observedRunProjectionHits));
|
||||
"AetheriaUnityObservedRunProjection is legacy projection chaff; gameplay boot should project the managed sector-map document directly.");
|
||||
}
|
||||
|
||||
var forbiddenMainMenuReaderSymbols = new[]
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>
|
||||
_observedFrameApplier ??= new AetheriaUnityObservedFrameApplier(
|
||||
ResolveDaemonObserver,
|
||||
zoneIndex => AetheriaUnityObservedRunProjection.FindZone(ObservedGalaxy, zoneIndex),
|
||||
ResolveObservedGalaxyZone,
|
||||
() => Zone,
|
||||
zone => Zone = zone,
|
||||
_observedEntityIndex,
|
||||
|
|
@ -370,6 +370,20 @@ public class ActionGameManager : MonoBehaviour
|
|||
return ObservedDocking.IsEntityUndocked(CurrentEntity);
|
||||
}
|
||||
|
||||
private GalaxyZone ResolveObservedGalaxyZone(int daemonZoneIndex)
|
||||
{
|
||||
if (daemonZoneIndex < 0 || ObservedGalaxy?.Zones == null)
|
||||
return null;
|
||||
|
||||
foreach (var zone in ObservedGalaxy.Zones)
|
||||
{
|
||||
if (zone != null && zone.ZoneIndex == daemonZoneIndex)
|
||||
return zone;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// public void ToggleEditMode()
|
||||
// {
|
||||
// _editMode = !_editMode;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public sealed class AetheriaUnityGameplayBootShell
|
|||
? Settings.TutorialBackgroundSettings
|
||||
: Settings.SectorBackgroundSettings;
|
||||
backgroundSettings.NoisePosition = sectorMap.GenerationSeed == 0 ? 1 : sectorMap.GenerationSeed;
|
||||
var observedGalaxy = AetheriaUnityObservedRunProjection.Project(
|
||||
var observedGalaxy = global::Galaxy.ProjectObservedSectorMap(
|
||||
sectorMap,
|
||||
backgroundSettings,
|
||||
runtimeCatalog,
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
|
||||
public static class AetheriaUnityObservedRunProjection
|
||||
{
|
||||
public static Galaxy Project(
|
||||
AetheriaRuntimeSectorMapDocument sectorMap,
|
||||
SectorBackgroundSettings backgroundSettings,
|
||||
AetheriaRuntimeCatalogSnapshot runtimeCatalog,
|
||||
Action<string> log)
|
||||
{
|
||||
return global::Galaxy.ProjectObservedSectorMap(sectorMap, backgroundSettings, runtimeCatalog, log);
|
||||
}
|
||||
|
||||
public static GalaxyZone FindZone(Galaxy galaxy, int daemonZoneIndex)
|
||||
{
|
||||
return daemonZoneIndex < 0
|
||||
? null
|
||||
: galaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5262d4719f1ec6647a465a9450b2787c
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 49ec0c83548c7084ab0d3f6c2175ee71
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue