Demote observed galaxy ownership

This commit is contained in:
Meta Vens 2026-07-06 02:35:18 +01:00
commit f3eb81250c
3 changed files with 23 additions and 24 deletions

View file

@ -19,7 +19,6 @@ public class ActionGameManager : MonoBehaviour
private AetheriaUnityPilotCommandSender _pilotCommands;
private AetheriaUnityObservedEntityRestorer _observedEntityRestorer;
private AetheriaUnityCurrentEntityBinder _currentEntityBinder;
private AetheriaUnityObservedZoneContextFactory _observedZoneContextFactory;
private AetheriaUnityPilotFrameController _pilotFrameController;
private AetheriaUnityPilotOperationController _pilotOperationController;
private AetheriaUnityObservedFrameApplier _observedFrameApplier;
@ -45,13 +44,7 @@ public class ActionGameManager : MonoBehaviour
EntityBlueprintMaterializer.MaterializeObservedEntity,
_loadoutItemFactory.CreateLoadoutItem,
Debug.LogWarning);
private AetheriaUnityObservedZoneContextFactory ObservedZoneContextFactory =>
_observedZoneContextFactory ??= new AetheriaUnityObservedZoneContextFactory(
ItemManager,
Settings.PlanetSettings,
() => ObservedGalaxy,
Debug.LogWarning,
PlayMusic);
private AetheriaUnityObservedZoneContextFactory ObservedZoneContextFactory { get; set; }
private AetheriaUnityCurrentEntityBinder CurrentEntityBinder =>
_currentEntityBinder ??= new AetheriaUnityCurrentEntityBinder
{
@ -282,7 +275,6 @@ public class ActionGameManager : MonoBehaviour
private ItemManager ItemManager { get; set; }
private AetheriaUnityLoadoutItemFactory _loadoutItemFactory;
private Galaxy ObservedGalaxy { get; set; }
private Zone Zone { get; set; }
private readonly AetheriaUnityDragSession _dragSession = new AetheriaUnityDragSession();
@ -299,7 +291,12 @@ public class ActionGameManager : MonoBehaviour
var boot = GameplayBootShell.Boot();
ItemManager = boot.ItemManager;
_loadoutItemFactory = boot.LoadoutItemFactory;
ObservedGalaxy = boot.ObservedGalaxy;
ObservedZoneContextFactory = new AetheriaUnityObservedZoneContextFactory(
ItemManager,
Settings.PlanetSettings,
boot.ObservedGalaxy,
Debug.LogWarning,
PlayMusic);
SceneWiring.ConfigureCurrentEntityPresentation(_currentEntityPresentation, boot.RuntimeCatalog);
SceneWiring.ConfigureTargetPresentation(
_targetPresentation,

View file

@ -15,21 +15,20 @@ public sealed class AetheriaUnityObservedZoneContextFactory
private readonly Dictionary<int, Zone> _observedZoneContextsByDaemonIndex = new Dictionary<int, Zone>();
private readonly ItemManager _itemManager;
private readonly PlanetSettings _planetSettings;
private readonly Func<Galaxy> _resolveObservedGalaxy;
private readonly Action<string> _logWarning;
private readonly Action<MusicType> _playMusic;
private Galaxy _observedGalaxy;
private readonly Galaxy _observedGalaxy;
public AetheriaUnityObservedZoneContextFactory(
ItemManager itemManager,
PlanetSettings planetSettings,
Func<Galaxy> resolveObservedGalaxy,
Galaxy observedGalaxy,
Action<string> logWarning,
Action<MusicType> playMusic)
{
_itemManager = itemManager ?? throw new ArgumentNullException(nameof(itemManager));
_planetSettings = planetSettings ?? throw new ArgumentNullException(nameof(planetSettings));
_resolveObservedGalaxy = resolveObservedGalaxy ?? (() => null);
_observedGalaxy = observedGalaxy;
_logWarning = logWarning ?? (_ => { });
_playMusic = playMusic ?? (_ => { });
}
@ -50,7 +49,6 @@ public sealed class AetheriaUnityObservedZoneContextFactory
var zoneIndex = render.ZoneIndex;
if (!_observedZoneContextsByDaemonIndex.TryGetValue(zoneIndex, out var observedZoneContext))
{
_observedGalaxy = _resolveObservedGalaxy();
if (_observedGalaxy == null)
{
_logWarning($"Daemon-authoritative zone population suppressed for {galaxyZone.Name}; no observed sector projection is available.");
@ -72,7 +70,6 @@ public sealed class AetheriaUnityObservedZoneContextFactory
if (daemonZoneIndex < 0)
return null;
_observedGalaxy ??= _resolveObservedGalaxy();
return _observedGalaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
}