Query observed zone snapshots explicitly
This commit is contained in:
parent
09389d9e68
commit
43c8c0ed76
4 changed files with 14 additions and 10 deletions
|
|
@ -896,14 +896,16 @@ public class ActionGameManager : MonoBehaviour
|
|||
: ObservedGalaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(int daemonZoneIndex)
|
||||
public bool TryGetObservedZoneSnapshot(int daemonZoneIndex, out AetheriaRuntimeZoneSnapshotCommit snapshot)
|
||||
{
|
||||
snapshot = null;
|
||||
if (daemonZoneIndex < 0)
|
||||
return null;
|
||||
return false;
|
||||
|
||||
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
|
||||
return (run?.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
snapshot = (run?.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == daemonZoneIndex);
|
||||
return snapshot != null;
|
||||
}
|
||||
|
||||
public bool TryGetObservedRunZone(out GalaxyZone galaxyZone)
|
||||
|
|
|
|||
|
|
@ -129,6 +129,6 @@ public class MapRenderer : MonoBehaviour
|
|||
InfluenceCamera.transform.position = pos;
|
||||
InfluenceCamera.orthographicSize = _size.y * Scale * .5f;
|
||||
|
||||
GameManager.ZoneRenderer.SetIconSize(IconSize * Scale);
|
||||
ZoneRenderer.SetIconSize(IconSize * Scale);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
.Where(name => !string.IsNullOrWhiteSpace(name))
|
||||
.ToArray();
|
||||
|
||||
var daemonZone = GameManager?.FindDaemonZoneSnapshot(zone?.ZoneIndex ?? -1);
|
||||
if (daemonZone == null)
|
||||
if (GameManager == null ||
|
||||
!GameManager.TryGetObservedZoneSnapshot(zone?.ZoneIndex ?? -1, out var daemonZone))
|
||||
{
|
||||
return new AetheriaRuntimeZoneDetailsSurfaceState(
|
||||
zone.Name,
|
||||
|
|
|
|||
Loading…
Reference in a new issue