diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 779778e92..00dac04f5 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -7927,16 +7927,14 @@ static void RequireUnityViewportAndMapReadsUseManagedAccessors(string root) "public AetheriaRuntimeSectorMapDocument LatestSectorMap()", "public AetheriaRuntimeZoneContactsDocument LatestZoneContacts()", "public AetheriaRuntimeCurrentZoneDocument LatestZone()", - "public AetheriaRuntimeCurrentZoneSession ObserveZone(", + "public CultMeshReactiveDocument ReactiveZone(", "public AetheriaRuntimeCurrentEntityDocument LatestEntity()", "public AetheriaRuntimeObjectsViewportDocument LatestObjects(AetheriaRuntimeRtsViewportBounds viewport)", "public CultMeshReactiveDocument ReactiveObjects(", - "public AetheriaRuntimeObjectsViewportSession ObserveObjects(", "public AetheriaRuntimeRenderSplatsViewportDocument LatestRenderSplats(AetheriaRuntimeRtsViewportBounds viewport)", "public CultMeshReactiveDocument ReactiveRenderSplats(", - "public AetheriaRuntimeRenderSplatsViewportSession ObserveRenderSplats(", "public AetheriaRuntimeZoneDetailsDocument LatestZone(int zoneIndex)", - "public AetheriaRuntimeZoneDetailsSession ObserveZone(" + "public CultMeshReactiveDocument ReactiveZone(" }; var missingClientSymbols = requiredClientSymbols .Where(symbol => !clientState.Contains(symbol, StringComparison.Ordinal)) @@ -15673,8 +15671,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) "public Observable Watch()", "public Task> ReactiveAsync(", "public CultMeshReactiveDocument Reactive(", - "public AetheriaRuntimeObservedDaemonState? CurrentObservedDaemon(", - "public AetheriaRuntimeObservedDaemonSession ObserveDaemon(" + "public AetheriaRuntimeObservedDaemonState? CurrentObservedDaemon(" }; var missingManagedStateAccessSymbols = requiredManagedStateAccessSymbols .Where(symbol => !aetheriaClientState.Contains(symbol, StringComparison.Ordinal)) @@ -15689,15 +15686,10 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) var requiredManagedObservedDaemonSymbols = new[] { "public AetheriaRuntimeObservedDaemonState? CurrentObservedDaemon(", - "public AetheriaRuntimeObservedDaemonSession ObserveDaemon(", "using var frame = ReactiveDaemonFrame(options);", "using var soaView = TryReactiveDaemonSoaView(options);", "using var zoneRender = ReactiveZoneRender(options);", - "AetheriaRuntimeObservedDaemonState.TryCreateCurrent(frame, soaView, zoneRender, out var current)", - "var frame = ReactiveDaemonFrame(options);", - "CultMeshReactiveDocument? soaView = null;", - "CultMeshReactiveDocument? zoneRender = null;", - "return new AetheriaRuntimeObservedDaemonSession(frame, soaView, zoneRender);" + "AetheriaRuntimeObservedDaemonState.TryCreateCurrent(frame, soaView, zoneRender, out var current)" }; var missingManagedObservedDaemonSymbols = requiredManagedObservedDaemonSymbols .Where(symbol => !aetheriaClientState.Contains(symbol, StringComparison.Ordinal)) @@ -15705,16 +15697,19 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) if (missingManagedObservedDaemonSymbols.Length > 0) { throw new InvalidOperationException( - "AetheriaClientState must compose current observed daemon state from managed typed reactive documents: " + + "AetheriaClientState must compose current observed daemon state from direct managed reactive typed documents: " + string.Join(", ", missingManagedObservedDaemonSymbols)); } if (!daemonRuntimeDocumentTests.Contains("ManagedStateSamplesCurrentObservedDaemonFromReactiveDocuments()", StringComparison.Ordinal) || - !daemonRuntimeDocumentTests.Contains("using var observedSession = client.State.ObserveDaemon();", StringComparison.Ordinal) || + !daemonRuntimeDocumentTests.Contains("using var observedFrame = client.State.ReactiveDaemonFrame();", StringComparison.Ordinal) || + !daemonRuntimeDocumentTests.Contains("using var observedSoaView = client.State.ReactiveDaemonSoaView();", StringComparison.Ordinal) || + !daemonRuntimeDocumentTests.Contains("using var observedZoneRender = client.State.ReactiveZoneRender();", StringComparison.Ordinal) || + !daemonRuntimeDocumentTests.Contains("AetheriaRuntimeObservedDaemonState.TryCreateCurrent(", StringComparison.Ordinal) || !daemonRuntimeDocumentTests.Contains("var sampledObserved = client.State.CurrentObservedDaemon();", StringComparison.Ordinal)) { throw new InvalidOperationException( - "Daemon runtime document tests must teach current observed daemon sampling through AetheriaClientState.ObserveDaemon() and CurrentObservedDaemon()."); + "Daemon runtime document tests must teach observed daemon sampling through direct reactive daemon documents and CurrentObservedDaemon()."); } var requiredObservedDaemonStateSymbols = new[] @@ -15726,15 +15721,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) "CultMeshReactiveDocument zoneRender", "var currentFrame = frame?.Current;", "var currentZoneRender = zoneRender?.Current;", - "new AetheriaRuntimeObservedDaemonState(currentFrame, currentSoaView, currentZoneRender)", - "public sealed class AetheriaRuntimeObservedDaemonSession", - "private readonly CultMeshReactiveDocument _frame;", - "private readonly CultMeshReactiveDocument? _soaView;", - "private readonly CultMeshReactiveDocument _zoneRender;", - "public AetheriaRuntimeObservedDaemonState? Current =>", - "_frame.Dispose();", - "_soaView?.Dispose();", - "_zoneRender.Dispose();" + "new AetheriaRuntimeObservedDaemonState(currentFrame, currentSoaView, currentZoneRender)" }; var missingObservedDaemonStateSymbols = requiredObservedDaemonStateSymbols .Where(symbol => !observedDaemonState.Contains(symbol, StringComparison.Ordinal)) @@ -15755,6 +15742,46 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) "Observed daemon state still composes legacy session wrappers instead of direct reactive CultMesh documents."); } + var clientStateSessionWrapperSymbols = new[] + { + "Session Observe", + "new AetheriaRuntimeCatalogSession", + "new AetheriaRuntimeDaemonFrameSession", + "new AetheriaRuntimeLoadoutTemplatesSession", + "new AetheriaRuntimeSectorMapSession", + "new AetheriaRuntimeZoneContactsSession", + "new AetheriaRuntimeStationRefitSession", + "new AetheriaRuntimeZoneRenderSession", + "new AetheriaRuntimeCurrentZoneSession", + "new AetheriaRuntimeCurrentEntitySession", + "new AetheriaRuntimeCurrentDockingSession", + "new AetheriaRuntimePlayerSettingsSession", + "new AetheriaRuntimeVerseHostSettingsSession", + "new AetheriaRuntimeObjectsViewportSession", + "new AetheriaRuntimeRenderSplatsViewportSession", + "new AetheriaRuntimeInventorySession", + "new AetheriaRuntimeStarbridgeScenarioSession", + "new AetheriaRuntimeStarbridgeRunSession", + "new AetheriaRuntimeStarbridgeSummarySession", + "new AetheriaRuntimeStarbridgePlayerSeatSession" + }; + var clientStateSessionWrapperHits = clientStateSessionWrapperSymbols + .Where(symbol => aetheriaClientState.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (clientStateSessionWrapperHits.Length > 0) + { + throw new InvalidOperationException( + "AetheriaClientState still exposes per-document Observe* session wrappers instead of direct Reactive* document access: " + + string.Join(", ", clientStateSessionWrapperHits)); + } + + var runtimeStateSessionsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeStateSessions.cs"); + if (File.Exists(runtimeStateSessionsPath)) + { + throw new InvalidOperationException( + "AetheriaRuntimeStateSessions.cs still exists; per-document session wrappers must be deleted in favor of direct CultMesh reactive documents."); + } + var forbiddenObservedDaemonStateSymbols = new[] { "string statePath", @@ -15882,13 +15909,17 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) !daemonObserver.Contains("AetheriaUnityRuntimeClientProvider.ResolveClient(", StringComparison.Ordinal) || !daemonObserver.Contains("AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory)", StringComparison.Ordinal) || !daemonObserver.Contains("AetheriaRuntimeObservedDaemonState", StringComparison.Ordinal) || - !daemonObserver.Contains("AetheriaRuntimeObservedDaemonSession _observedDaemon", StringComparison.Ordinal) || - !daemonObserver.Contains("_observedDaemon ??= ResolveClient()?.State?.ObserveDaemon();", StringComparison.Ordinal) || - !daemonObserver.Contains("return _observedDaemon?.Current;", StringComparison.Ordinal) || + !daemonObserver.Contains("CultMeshReactiveDocument _daemonFrame", StringComparison.Ordinal) || + !daemonObserver.Contains("CultMeshReactiveDocument _daemonSoaView", StringComparison.Ordinal) || + !daemonObserver.Contains("CultMeshReactiveDocument _zoneRender", StringComparison.Ordinal) || + !daemonObserver.Contains("_daemonFrame ??= state.ReactiveDaemonFrame();", StringComparison.Ordinal) || + !daemonObserver.Contains("_daemonSoaView ??= TryReactiveDaemonSoaView(state);", StringComparison.Ordinal) || + !daemonObserver.Contains("_zoneRender ??= state.ReactiveZoneRender();", StringComparison.Ordinal) || + !daemonObserver.Contains("AetheriaRuntimeObservedDaemonState.TryCreateCurrent(", StringComparison.Ordinal) || !daemonObserver.Contains("DisposeObservedDaemonSession()", StringComparison.Ordinal)) { throw new InvalidOperationException( - "AetheriaDaemonObserver must sample observed daemon state through a single managed AetheriaRuntimeObservedDaemonSession."); + "AetheriaDaemonObserver must sample observed daemon state through direct managed reactive daemon documents."); } if (daemonObserver.Contains("AetheriaRuntimeStateReader.TryReadObservedDaemonState", StringComparison.Ordinal) || @@ -15896,17 +15927,13 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) daemonObserver.Contains("AetheriaRuntimeReactiveObservedDaemonState", StringComparison.Ordinal) || daemonObserver.Contains(".ReactiveObservedDaemon()", StringComparison.Ordinal) || daemonObserver.Contains("reactive.TryCurrent(out var observed)", StringComparison.Ordinal) || - daemonObserver.Contains("CultMeshReactiveDocument _reactiveFrame", StringComparison.Ordinal) || - daemonObserver.Contains("CultMeshReactiveDocument _reactiveSoaView", StringComparison.Ordinal) || - daemonObserver.Contains("CultMeshReactiveDocument _reactiveZoneRender", StringComparison.Ordinal) || - daemonObserver.Contains("state.ReactiveDaemonFrame()", StringComparison.Ordinal) || - daemonObserver.Contains("state.ReactiveDaemonSoaView()", StringComparison.Ordinal) || - daemonObserver.Contains("state.ReactiveZoneRender()", StringComparison.Ordinal) || + daemonObserver.Contains("AetheriaRuntimeObservedDaemonSession", StringComparison.Ordinal) || + daemonObserver.Contains(".ObserveDaemon()", StringComparison.Ordinal) || daemonObserver.Contains("return new AetheriaRuntimeObservedDaemonState(frame, soaView, zoneRender);", StringComparison.Ordinal) || daemonObserver.Contains("DisposeReactiveObservedDaemonDocuments()", StringComparison.Ordinal)) { throw new InvalidOperationException( - "AetheriaDaemonObserver still owns raw observed daemon document plumbing instead of the managed observed-daemon session."); + "AetheriaDaemonObserver still routes through observed-daemon compatibility wrappers instead of direct reactive documents."); } if (daemonObserver.Contains("ObserveAsync()", StringComparison.Ordinal)) diff --git a/Assets/Scripts/Gameplay/AetheriaDaemonObserver.cs b/Assets/Scripts/Gameplay/AetheriaDaemonObserver.cs index 5b970fbce..f06f3d6b2 100644 --- a/Assets/Scripts/Gameplay/AetheriaDaemonObserver.cs +++ b/Assets/Scripts/Gameplay/AetheriaDaemonObserver.cs @@ -1,5 +1,6 @@ using System; using GameCult.Aetheria.State.Verse; +using GameCult.Mesh; using UnityEngine; public sealed class AetheriaDaemonObserver : MonoBehaviour @@ -20,7 +21,9 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour private float _nextPollTime; private AetheriaDaemonSoaMemoryMap _soaMemoryMap; private AetheriaDaemonRenderNativeView _renderNativeView; - private AetheriaRuntimeObservedDaemonSession _observedDaemon; + private CultMeshReactiveDocument _daemonFrame; + private CultMeshReactiveDocument _daemonSoaView; + private CultMeshReactiveDocument _zoneRender; public AetheriaRuntimeObservedDaemonState LastObservedState { get; private set; } public AetheriaRuntimeDaemonObservationResult LastObservation { get; private set; } @@ -100,8 +103,14 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour { try { - _observedDaemon ??= ResolveClient()?.State?.ObserveDaemon(); - return _observedDaemon?.Current; + EnsureObservedDaemonDocuments(); + return AetheriaRuntimeObservedDaemonState.TryCreateCurrent( + _daemonFrame, + _daemonSoaView, + _zoneRender, + out var observed) + ? observed + : null; } catch { @@ -109,6 +118,37 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour } } + private void EnsureObservedDaemonDocuments() + { + if (_daemonFrame != null && _zoneRender != null) + { + return; + } + + var state = ResolveClient()?.State; + if (state == null) + { + return; + } + + _daemonFrame ??= state.ReactiveDaemonFrame(); + _daemonSoaView ??= TryReactiveDaemonSoaView(state); + _zoneRender ??= state.ReactiveZoneRender(); + } + + private static CultMeshReactiveDocument TryReactiveDaemonSoaView( + AetheriaClientState state) + { + try + { + return state.ReactiveDaemonSoaView(); + } + catch (System.Collections.Generic.KeyNotFoundException) + { + return null; + } + } + private AetheriaClient ResolveClient() { var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory); @@ -159,7 +199,11 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour private void DisposeObservedDaemonSession() { - _observedDaemon?.Dispose(); - _observedDaemon = null; + _daemonFrame?.Dispose(); + _daemonFrame = null; + _daemonSoaView?.Dispose(); + _daemonSoaView = null; + _zoneRender?.Dispose(); + _zoneRender = null; } } diff --git a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs index 3cef0117a..d87a5ebc9 100644 --- a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs +++ b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs @@ -2263,8 +2263,16 @@ public class DaemonRuntimeDocumentTests .OpenAsync(statePath, "unity-reactive-observer-test", pullOnOpen: true) .GetAwaiter() .GetResult(); - using var observedSession = client.State.ObserveDaemon(); - var observed = observedSession.Current; + using var observedFrame = client.State.ReactiveDaemonFrame(); + using var observedSoaView = client.State.ReactiveDaemonSoaView(); + using var observedZoneRender = client.State.ReactiveZoneRender(); + var observed = AetheriaRuntimeObservedDaemonState.TryCreateCurrent( + observedFrame, + observedSoaView, + observedZoneRender, + out var currentObserved) + ? currentObserved + : null; var sampledObserved = client.State.CurrentObservedDaemon(); Assert.IsNotNull(observed); Assert.IsNotNull(sampledObserved); diff --git a/GameCult.Aetheria.State.Unity.csproj b/GameCult.Aetheria.State.Unity.csproj index 71aeda1a2..624df2d16 100644 --- a/GameCult.Aetheria.State.Unity.csproj +++ b/GameCult.Aetheria.State.Unity.csproj @@ -75,7 +75,6 @@ - @@ -114,7 +113,6 @@ - diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs index cbac375c6..178dc11dd 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs @@ -199,12 +199,6 @@ namespace GameCult.Aetheria.State.Verse return Catalog.Reactive(options); } - public AetheriaRuntimeCatalogSession ObserveCatalog( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeCatalogSession(ReactiveCatalog(options)); - } - public Task LatestDaemonFrameAsync() { return LatestFrame.LatestAsync(); @@ -227,12 +221,6 @@ namespace GameCult.Aetheria.State.Verse return LatestFrame.Reactive(options); } - public AetheriaRuntimeDaemonFrameSession ObserveDaemonFrame( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeDaemonFrameSession(ReactiveDaemonFrame(options)); - } - public Task LatestDaemonSoaViewAsync() { return LatestSoaView.LatestAsync(); @@ -255,12 +243,6 @@ namespace GameCult.Aetheria.State.Verse return LatestSoaView.Reactive(options); } - public AetheriaRuntimeDaemonSoaViewSession ObserveDaemonSoaView( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeDaemonSoaViewSession(ReactiveDaemonSoaView(options)); - } - public async Task LatestObservedDaemonAsync() { var frame = await LatestDaemonFrameAsync().ConfigureAwait(false); @@ -285,27 +267,6 @@ namespace GameCult.Aetheria.State.Verse : null; } - public AetheriaRuntimeObservedDaemonSession ObserveDaemon( - CultMeshReactiveDocumentOptions? options = null) - { - var frame = ReactiveDaemonFrame(options); - CultMeshReactiveDocument? soaView = null; - CultMeshReactiveDocument? zoneRender = null; - try - { - soaView = TryReactiveDaemonSoaView(options); - zoneRender = ReactiveZoneRender(options); - return new AetheriaRuntimeObservedDaemonSession(frame, soaView, zoneRender); - } - catch - { - frame.Dispose(); - soaView?.Dispose(); - zoneRender?.Dispose(); - throw; - } - } - public AetheriaRuntimeObservedDockingState? CurrentDocking( CultMeshReactiveDocumentOptions? options = null) { @@ -495,12 +456,6 @@ namespace GameCult.Aetheria.State.Verse return LoadoutTemplates.Reactive(options); } - public AetheriaRuntimeLoadoutTemplatesSession ObserveLoadoutTemplates( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeLoadoutTemplatesSession(ReactiveLoadoutTemplates(options)); - } - public Task LatestSectorMapAsync() { return SectorMap.LatestAsync(); @@ -523,12 +478,6 @@ namespace GameCult.Aetheria.State.Verse return SectorMap.Reactive(options); } - public AetheriaRuntimeSectorMapSession ObserveSectorMap( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeSectorMapSession(ReactiveSectorMap(options)); - } - public Task LatestZoneContactsAsync() { return ZoneContacts.LatestAsync(); @@ -551,12 +500,6 @@ namespace GameCult.Aetheria.State.Verse return ZoneContacts.Reactive(options); } - public AetheriaRuntimeZoneContactsSession ObserveZoneContacts( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeZoneContactsSession(ReactiveZoneContacts(options)); - } - public Task LatestStationRefitAsync() { return StationRefit.LatestAsync(); @@ -579,12 +522,6 @@ namespace GameCult.Aetheria.State.Verse return StationRefit.Reactive(options); } - public AetheriaRuntimeStationRefitSession ObserveStationRefit( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeStationRefitSession(ReactiveStationRefit(options)); - } - public Task LatestZoneRenderAsync() { return ZoneRender.LatestAsync(); @@ -607,12 +544,6 @@ namespace GameCult.Aetheria.State.Verse return ZoneRender.Reactive(options); } - public AetheriaRuntimeZoneRenderSession ObserveZoneRender( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeZoneRenderSession(ReactiveZoneRender(options)); - } - public Observable Watch() where TDocument : class { @@ -901,12 +832,6 @@ namespace GameCult.Aetheria.State.Verse return Zone.Reactive(options); } - public AetheriaRuntimeCurrentZoneSession ObserveZone( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeCurrentZoneSession(ReactiveZone(options)); - } - public Task LatestEntityAsync() { return Entity.LatestAsync(); @@ -929,12 +854,6 @@ namespace GameCult.Aetheria.State.Verse return Entity.Reactive(options); } - public AetheriaRuntimeCurrentEntitySession ObserveEntity( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeCurrentEntitySession(ReactiveEntity(options)); - } - public Task LatestDockingAsync() { return Docking.LatestAsync(); @@ -957,11 +876,6 @@ namespace GameCult.Aetheria.State.Verse return Docking.Reactive(options); } - public AetheriaRuntimeCurrentDockingSession ObserveDocking( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeCurrentDockingSession(ReactiveDocking(options)); - } } public sealed class AetheriaClientSettingsState @@ -1000,12 +914,6 @@ namespace GameCult.Aetheria.State.Verse return Player.Reactive(options); } - public AetheriaRuntimePlayerSettingsSession ObservePlayer( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimePlayerSettingsSession(ReactivePlayer(options)); - } - public Task LatestVerseHostAsync() { return VerseHost.LatestAsync(); @@ -1028,11 +936,6 @@ namespace GameCult.Aetheria.State.Verse return VerseHost.Reactive(options); } - public AetheriaRuntimeVerseHostSettingsSession ObserveVerseHost( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeVerseHostSettingsSession(ReactiveVerseHost(options)); - } } public sealed class AetheriaClientViewportState @@ -1083,13 +986,6 @@ namespace GameCult.Aetheria.State.Verse return Map(viewport).Reactive(options); } - public AetheriaRuntimeMapViewportSession ObserveMap( - AetheriaRuntimeRtsViewportBounds viewport, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeMapViewportSession(ReactiveMap(viewport, options)); - } - public CultMeshDocumentHandle Objects(AetheriaRuntimeRtsViewportBounds viewport) { return _objects(viewport ?? new AetheriaRuntimeRtsViewportBounds()); @@ -1119,13 +1015,6 @@ namespace GameCult.Aetheria.State.Verse return Objects(viewport).Reactive(options); } - public AetheriaRuntimeObjectsViewportSession ObserveObjects( - AetheriaRuntimeRtsViewportBounds viewport, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeObjectsViewportSession(ReactiveObjects(viewport, options)); - } - public CultMeshDocumentHandle Gravity(AetheriaRuntimeRtsViewportBounds viewport) { return _gravity(viewport ?? new AetheriaRuntimeRtsViewportBounds()); @@ -1155,13 +1044,6 @@ namespace GameCult.Aetheria.State.Verse return Gravity(viewport).Reactive(options); } - public AetheriaRuntimeGravityViewportSession ObserveGravity( - AetheriaRuntimeRtsViewportBounds viewport, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeGravityViewportSession(ReactiveGravity(viewport, options)); - } - public CultMeshDocumentHandle RenderSplats(AetheriaRuntimeRtsViewportBounds viewport) { return _renderSplats(viewport ?? new AetheriaRuntimeRtsViewportBounds()); @@ -1191,12 +1073,6 @@ namespace GameCult.Aetheria.State.Verse return RenderSplats(viewport).Reactive(options); } - public AetheriaRuntimeRenderSplatsViewportSession ObserveRenderSplats( - AetheriaRuntimeRtsViewportBounds viewport, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeRenderSplatsViewportSession(ReactiveRenderSplats(viewport, options)); - } } public sealed class AetheriaClientDetailState @@ -1244,13 +1120,6 @@ namespace GameCult.Aetheria.State.Verse return Zone(zoneIndex).Reactive(options); } - public AetheriaRuntimeZoneDetailsSession ObserveZone( - int zoneIndex, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeZoneDetailsSession(ReactiveZone(zoneIndex, options)); - } - public CultMeshDocumentHandle SelectedObject(int entityIndex) { return _selectedObject(entityIndex); @@ -1280,13 +1149,6 @@ namespace GameCult.Aetheria.State.Verse return SelectedObject(entityIndex).Reactive(options); } - public AetheriaRuntimeSelectedObjectSession ObserveSelectedObject( - int entityIndex, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeSelectedObjectSession(ReactiveSelectedObject(entityIndex, options)); - } - public CultMeshDocumentHandle Inventory(int entityIndex) { return _inventory(entityIndex); @@ -1316,12 +1178,6 @@ namespace GameCult.Aetheria.State.Verse return Inventory(entityIndex).Reactive(options); } - public AetheriaRuntimeInventorySession ObserveInventory( - int entityIndex, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeInventorySession(ReactiveInventory(entityIndex, options)); - } } public sealed class AetheriaClientStarbridgeState @@ -1375,12 +1231,6 @@ namespace GameCult.Aetheria.State.Verse return Scenario.Reactive(options); } - public AetheriaRuntimeStarbridgeScenarioSession ObserveScenario( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeStarbridgeScenarioSession(ReactiveScenario(options)); - } - public Task LatestSessionAsync() { return Session.LatestAsync(); @@ -1403,12 +1253,6 @@ namespace GameCult.Aetheria.State.Verse return Session.Reactive(options); } - public AetheriaRuntimeStarbridgeRunSession ObserveSession( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeStarbridgeRunSession(ReactiveSession(options)); - } - public Task LatestSummaryAsync() { return Summary.LatestAsync(); @@ -1431,12 +1275,6 @@ namespace GameCult.Aetheria.State.Verse return Summary.Reactive(options); } - public AetheriaRuntimeStarbridgeSummarySession ObserveSummary( - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeStarbridgeSummarySession(ReactiveSummary(options)); - } - public Task LatestPlayerSeatAsync(string seatId) { return PlayerSeat(seatId).LatestAsync(); @@ -1461,11 +1299,5 @@ namespace GameCult.Aetheria.State.Verse return PlayerSeat(seatId).Reactive(options); } - public AetheriaRuntimeStarbridgePlayerSeatSession ObservePlayerSeat( - string seatId, - CultMeshReactiveDocumentOptions? options = null) - { - return new AetheriaRuntimeStarbridgePlayerSeatSession(ReactivePlayerSeat(seatId, options)); - } } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeObservedDaemonState.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeObservedDaemonState.cs index 73230cf51..27836a331 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeObservedDaemonState.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeObservedDaemonState.cs @@ -57,33 +57,4 @@ namespace GameCult.Aetheria.State.Verse } } - - public sealed class AetheriaRuntimeObservedDaemonSession : IDisposable - { - private readonly CultMeshReactiveDocument _frame; - private readonly CultMeshReactiveDocument? _soaView; - private readonly CultMeshReactiveDocument _zoneRender; - - public AetheriaRuntimeObservedDaemonSession( - CultMeshReactiveDocument frame, - CultMeshReactiveDocument? soaView, - CultMeshReactiveDocument zoneRender) - { - _frame = frame ?? throw new ArgumentNullException(nameof(frame)); - _soaView = soaView; - _zoneRender = zoneRender ?? throw new ArgumentNullException(nameof(zoneRender)); - } - - public AetheriaRuntimeObservedDaemonState? Current => - AetheriaRuntimeObservedDaemonState.TryCreateCurrent(_frame, _soaView, _zoneRender, out var current) - ? current - : null; - - public void Dispose() - { - _frame.Dispose(); - _soaView?.Dispose(); - _zoneRender.Dispose(); - } - } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs deleted file mode 100644 index ea9ba764a..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs +++ /dev/null @@ -1,241 +0,0 @@ -using System; -using GameCult.Mesh; - -#nullable enable - -namespace GameCult.Aetheria.State.Verse -{ - public abstract class AetheriaRuntimeReactiveSession : IDisposable - where TDocument : class - { - private readonly CultMeshReactiveDocument _document; - - protected AetheriaRuntimeReactiveSession(CultMeshReactiveDocument document) - { - _document = document ?? throw new ArgumentNullException(nameof(document)); - } - - public TDocument? Current => _document.Current; - - public void Dispose() - { - _document.Dispose(); - } - } - - public sealed class AetheriaRuntimeCatalogSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeCatalogSession(CultMeshReactiveDocument catalog) - : base(catalog) - { - } - } - - public sealed class AetheriaRuntimePlayerSettingsSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimePlayerSettingsSession(CultMeshReactiveDocument playerSettings) - : base(playerSettings) - { - } - } - - public sealed class AetheriaRuntimeVerseHostSettingsSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeVerseHostSettingsSession(CultMeshReactiveDocument verseHostSettings) - : base(verseHostSettings) - { - } - } - - public sealed class AetheriaRuntimeSectorMapSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeSectorMapSession(CultMeshReactiveDocument sectorMap) - : base(sectorMap) - { - } - } - - public sealed class AetheriaRuntimeDaemonFrameSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeDaemonFrameSession(CultMeshReactiveDocument daemonFrame) - : base(daemonFrame) - { - } - } - - public sealed class AetheriaRuntimeDaemonSoaViewSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeDaemonSoaViewSession(CultMeshReactiveDocument soaView) - : base(soaView) - { - } - } - - public sealed class AetheriaRuntimeZoneContactsSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeZoneContactsSession(CultMeshReactiveDocument zoneContacts) - : base(zoneContacts) - { - } - } - - public sealed class AetheriaRuntimeStationRefitSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeStationRefitSession(CultMeshReactiveDocument stationRefit) - : base(stationRefit) - { - } - } - - public sealed class AetheriaRuntimeZoneRenderSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeZoneRenderSession(CultMeshReactiveDocument zoneRender) - : base(zoneRender) - { - } - } - - public sealed class AetheriaRuntimeCurrentZoneSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeCurrentZoneSession(CultMeshReactiveDocument currentZone) - : base(currentZone) - { - } - } - - public sealed class AetheriaRuntimeCurrentEntitySession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeCurrentEntitySession(CultMeshReactiveDocument currentEntity) - : base(currentEntity) - { - } - } - - public sealed class AetheriaRuntimeCurrentDockingSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeCurrentDockingSession(CultMeshReactiveDocument currentDocking) - : base(currentDocking) - { - } - } - - public sealed class AetheriaRuntimeZoneDetailsSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeZoneDetailsSession(CultMeshReactiveDocument zoneDetails) - : base(zoneDetails) - { - } - } - - public sealed class AetheriaRuntimeInventorySession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeInventorySession(CultMeshReactiveDocument inventory) - : base(inventory) - { - } - } - - public sealed class AetheriaRuntimeObjectsViewportSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeObjectsViewportSession(CultMeshReactiveDocument objectsViewport) - : base(objectsViewport) - { - } - } - - public sealed class AetheriaRuntimeMapViewportSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeMapViewportSession(CultMeshReactiveDocument mapViewport) - : base(mapViewport) - { - } - } - - public sealed class AetheriaRuntimeRenderSplatsViewportSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeRenderSplatsViewportSession(CultMeshReactiveDocument renderSplatsViewport) - : base(renderSplatsViewport) - { - } - } - - public sealed class AetheriaRuntimeGravityViewportSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeGravityViewportSession(CultMeshReactiveDocument gravityViewport) - : base(gravityViewport) - { - } - } - - public sealed class AetheriaRuntimeSelectedObjectSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeSelectedObjectSession(CultMeshReactiveDocument selectedObject) - : base(selectedObject) - { - } - } - - public sealed class AetheriaRuntimeLoadoutTemplatesSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeLoadoutTemplatesSession(CultMeshReactiveDocument loadoutTemplates) - : base(loadoutTemplates) - { - } - } - - public sealed class AetheriaRuntimeStarbridgeScenarioSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeStarbridgeScenarioSession(CultMeshReactiveDocument scenario) - : base(scenario) - { - } - } - - public sealed class AetheriaRuntimeStarbridgeRunSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeStarbridgeRunSession(CultMeshReactiveDocument session) - : base(session) - { - } - } - - public sealed class AetheriaRuntimeStarbridgeSummarySession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeStarbridgeSummarySession(CultMeshReactiveDocument summary) - : base(summary) - { - } - } - - public sealed class AetheriaRuntimeStarbridgePlayerSeatSession - : AetheriaRuntimeReactiveSession - { - public AetheriaRuntimeStarbridgePlayerSeatSession(CultMeshReactiveDocument playerSeat) - : base(playerSeat) - { - } - } -} diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs.meta b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs.meta deleted file mode 100644 index 7a217367a..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateSessions.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 0a8d20b7f1c74745a9456dbf7bcd63c0