Remove reactive state session wrappers

This commit is contained in:
Meta Vens 2026-06-28 23:27:50 +01:00
commit c5d92cbf53
8 changed files with 121 additions and 484 deletions

View file

@ -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<AetheriaRuntimeDaemonFrameDocument> 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<AetheriaRuntimeDaemonSoaViewDocument> 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<AetheriaRuntimeObservedDaemonState?> 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<AetheriaRuntimeDaemonSoaViewDocument>? soaView = null;
CultMeshReactiveDocument<AetheriaRuntimeZoneRenderDocument>? 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<AetheriaRuntimeSectorMapDocument> 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<AetheriaRuntimeZoneContactsDocument> 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<AetheriaRuntimeStationRefitDocument> 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<AetheriaRuntimeZoneRenderDocument> 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<TDocument> Watch<TDocument>()
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<AetheriaRuntimeCurrentEntityDocument> 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<AetheriaRuntimeCurrentDockingDocument> 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<AetheriaRuntimeVerseHostSettingsDocument> 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<AetheriaRuntimeObjectsViewportDocument> 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<AetheriaRuntimeGravityViewportDocument> 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<AetheriaRuntimeRenderSplatsViewportDocument> 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<AetheriaRuntimeSelectedObjectDocument> 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<AetheriaRuntimeInventoryDocument> 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<AetheriaRuntimeStarbridgeSessionDocument> 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<AetheriaRuntimeStarbridgeSessionSummaryDocument> 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<AetheriaRuntimeStarbridgePlayerSeatDocument> 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));
}
}
}

View file

@ -57,33 +57,4 @@ namespace GameCult.Aetheria.State.Verse
}
}
public sealed class AetheriaRuntimeObservedDaemonSession : IDisposable
{
private readonly CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument> _frame;
private readonly CultMeshReactiveDocument<AetheriaRuntimeDaemonSoaViewDocument>? _soaView;
private readonly CultMeshReactiveDocument<AetheriaRuntimeZoneRenderDocument> _zoneRender;
public AetheriaRuntimeObservedDaemonSession(
CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument> frame,
CultMeshReactiveDocument<AetheriaRuntimeDaemonSoaViewDocument>? soaView,
CultMeshReactiveDocument<AetheriaRuntimeZoneRenderDocument> 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();
}
}
}

View file

@ -1,241 +0,0 @@
using System;
using GameCult.Mesh;
#nullable enable
namespace GameCult.Aetheria.State.Verse
{
public abstract class AetheriaRuntimeReactiveSession<TDocument> : IDisposable
where TDocument : class
{
private readonly CultMeshReactiveDocument<TDocument> _document;
protected AetheriaRuntimeReactiveSession(CultMeshReactiveDocument<TDocument> document)
{
_document = document ?? throw new ArgumentNullException(nameof(document));
}
public TDocument? Current => _document.Current;
public void Dispose()
{
_document.Dispose();
}
}
public sealed class AetheriaRuntimeCatalogSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeCatalogSnapshot>
{
public AetheriaRuntimeCatalogSession(CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> catalog)
: base(catalog)
{
}
}
public sealed class AetheriaRuntimePlayerSettingsSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimePlayerSettingsDocument>
{
public AetheriaRuntimePlayerSettingsSession(CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> playerSettings)
: base(playerSettings)
{
}
}
public sealed class AetheriaRuntimeVerseHostSettingsSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeVerseHostSettingsDocument>
{
public AetheriaRuntimeVerseHostSettingsSession(CultMeshReactiveDocument<AetheriaRuntimeVerseHostSettingsDocument> verseHostSettings)
: base(verseHostSettings)
{
}
}
public sealed class AetheriaRuntimeSectorMapSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeSectorMapDocument>
{
public AetheriaRuntimeSectorMapSession(CultMeshReactiveDocument<AetheriaRuntimeSectorMapDocument> sectorMap)
: base(sectorMap)
{
}
}
public sealed class AetheriaRuntimeDaemonFrameSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeDaemonFrameDocument>
{
public AetheriaRuntimeDaemonFrameSession(CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument> daemonFrame)
: base(daemonFrame)
{
}
}
public sealed class AetheriaRuntimeDaemonSoaViewSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeDaemonSoaViewDocument>
{
public AetheriaRuntimeDaemonSoaViewSession(CultMeshReactiveDocument<AetheriaRuntimeDaemonSoaViewDocument> soaView)
: base(soaView)
{
}
}
public sealed class AetheriaRuntimeZoneContactsSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeZoneContactsDocument>
{
public AetheriaRuntimeZoneContactsSession(CultMeshReactiveDocument<AetheriaRuntimeZoneContactsDocument> zoneContacts)
: base(zoneContacts)
{
}
}
public sealed class AetheriaRuntimeStationRefitSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeStationRefitDocument>
{
public AetheriaRuntimeStationRefitSession(CultMeshReactiveDocument<AetheriaRuntimeStationRefitDocument> stationRefit)
: base(stationRefit)
{
}
}
public sealed class AetheriaRuntimeZoneRenderSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeZoneRenderDocument>
{
public AetheriaRuntimeZoneRenderSession(CultMeshReactiveDocument<AetheriaRuntimeZoneRenderDocument> zoneRender)
: base(zoneRender)
{
}
}
public sealed class AetheriaRuntimeCurrentZoneSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeCurrentZoneDocument>
{
public AetheriaRuntimeCurrentZoneSession(CultMeshReactiveDocument<AetheriaRuntimeCurrentZoneDocument> currentZone)
: base(currentZone)
{
}
}
public sealed class AetheriaRuntimeCurrentEntitySession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeCurrentEntityDocument>
{
public AetheriaRuntimeCurrentEntitySession(CultMeshReactiveDocument<AetheriaRuntimeCurrentEntityDocument> currentEntity)
: base(currentEntity)
{
}
}
public sealed class AetheriaRuntimeCurrentDockingSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeCurrentDockingDocument>
{
public AetheriaRuntimeCurrentDockingSession(CultMeshReactiveDocument<AetheriaRuntimeCurrentDockingDocument> currentDocking)
: base(currentDocking)
{
}
}
public sealed class AetheriaRuntimeZoneDetailsSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeZoneDetailsDocument>
{
public AetheriaRuntimeZoneDetailsSession(CultMeshReactiveDocument<AetheriaRuntimeZoneDetailsDocument> zoneDetails)
: base(zoneDetails)
{
}
}
public sealed class AetheriaRuntimeInventorySession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeInventoryDocument>
{
public AetheriaRuntimeInventorySession(CultMeshReactiveDocument<AetheriaRuntimeInventoryDocument> inventory)
: base(inventory)
{
}
}
public sealed class AetheriaRuntimeObjectsViewportSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeObjectsViewportDocument>
{
public AetheriaRuntimeObjectsViewportSession(CultMeshReactiveDocument<AetheriaRuntimeObjectsViewportDocument> objectsViewport)
: base(objectsViewport)
{
}
}
public sealed class AetheriaRuntimeMapViewportSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeRtsViewportDocument>
{
public AetheriaRuntimeMapViewportSession(CultMeshReactiveDocument<AetheriaRuntimeRtsViewportDocument> mapViewport)
: base(mapViewport)
{
}
}
public sealed class AetheriaRuntimeRenderSplatsViewportSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeRenderSplatsViewportDocument>
{
public AetheriaRuntimeRenderSplatsViewportSession(CultMeshReactiveDocument<AetheriaRuntimeRenderSplatsViewportDocument> renderSplatsViewport)
: base(renderSplatsViewport)
{
}
}
public sealed class AetheriaRuntimeGravityViewportSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeGravityViewportDocument>
{
public AetheriaRuntimeGravityViewportSession(CultMeshReactiveDocument<AetheriaRuntimeGravityViewportDocument> gravityViewport)
: base(gravityViewport)
{
}
}
public sealed class AetheriaRuntimeSelectedObjectSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeSelectedObjectDocument>
{
public AetheriaRuntimeSelectedObjectSession(CultMeshReactiveDocument<AetheriaRuntimeSelectedObjectDocument> selectedObject)
: base(selectedObject)
{
}
}
public sealed class AetheriaRuntimeLoadoutTemplatesSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeLoadoutTemplatesDocument>
{
public AetheriaRuntimeLoadoutTemplatesSession(CultMeshReactiveDocument<AetheriaRuntimeLoadoutTemplatesDocument> loadoutTemplates)
: base(loadoutTemplates)
{
}
}
public sealed class AetheriaRuntimeStarbridgeScenarioSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeStarbridgeScenarioDocument>
{
public AetheriaRuntimeStarbridgeScenarioSession(CultMeshReactiveDocument<AetheriaRuntimeStarbridgeScenarioDocument> scenario)
: base(scenario)
{
}
}
public sealed class AetheriaRuntimeStarbridgeRunSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeStarbridgeSessionDocument>
{
public AetheriaRuntimeStarbridgeRunSession(CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionDocument> session)
: base(session)
{
}
}
public sealed class AetheriaRuntimeStarbridgeSummarySession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeStarbridgeSessionSummaryDocument>
{
public AetheriaRuntimeStarbridgeSummarySession(CultMeshReactiveDocument<AetheriaRuntimeStarbridgeSessionSummaryDocument> summary)
: base(summary)
{
}
}
public sealed class AetheriaRuntimeStarbridgePlayerSeatSession
: AetheriaRuntimeReactiveSession<AetheriaRuntimeStarbridgePlayerSeatDocument>
{
public AetheriaRuntimeStarbridgePlayerSeatSession(CultMeshReactiveDocument<AetheriaRuntimeStarbridgePlayerSeatDocument> playerSeat)
: base(playerSeat)
{
}
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 0a8d20b7f1c74745a9456dbf7bcd63c0