Use generic reactive daemon documents

This commit is contained in:
Meta Vens 2026-06-28 23:41:03 +01:00
commit 0e694abe9a
7 changed files with 54 additions and 81 deletions

View file

@ -131,17 +131,18 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour
return;
}
_daemonFrame ??= state.ReactiveDaemonFrame();
_daemonSoaView ??= TryReactiveDaemonSoaView(state);
_zoneRender ??= state.ReactiveZoneRender();
_daemonFrame ??= state.Reactive<AetheriaRuntimeDaemonFrameDocument>();
_daemonSoaView ??= TryReactive<AetheriaRuntimeDaemonSoaViewDocument>(state);
_zoneRender ??= state.Reactive<AetheriaRuntimeZoneRenderDocument>();
}
private static CultMeshReactiveDocument<AetheriaRuntimeDaemonSoaViewDocument> TryReactiveDaemonSoaView(
private static CultMeshReactiveDocument<TDocument> TryReactive<TDocument>(
AetheriaClientState state)
where TDocument : class
{
try
{
return state.ReactiveDaemonSoaView();
return state.Reactive<TDocument>();
}
catch (System.Collections.Generic.KeyNotFoundException)
{

View file

@ -206,8 +206,8 @@ public class DaemonRuntimeDocumentTests
var observed = client.State.LatestObservedDaemon();
var observedAuthoritativeFrame = client.State.LatestDaemonFrame();
using var catalogReactive = client.State.ReactiveCatalog();
using var daemonFrameReactive = client.State.ReactiveDaemonFrame();
using var daemonSoaViewReactive = client.State.ReactiveDaemonSoaView();
using var daemonFrameReactive = client.State.Reactive<AetheriaRuntimeDaemonFrameDocument>();
using var daemonSoaViewReactive = client.State.Reactive<AetheriaRuntimeDaemonSoaViewDocument>();
using var loadoutTemplatesReactive = client.State.ReactiveLoadoutTemplates();
using var sectorMapReactive = client.State.ReactiveSectorMap();
using var playerSettingsReactive = client.State.Settings.ReactivePlayer();
@ -2263,9 +2263,9 @@ public class DaemonRuntimeDocumentTests
.OpenAsync(statePath, "unity-reactive-observer-test", pullOnOpen: true)
.GetAwaiter()
.GetResult();
using var observedFrame = client.State.ReactiveDaemonFrame();
using var observedSoaView = client.State.ReactiveDaemonSoaView();
using var observedZoneRender = client.State.ReactiveZoneRender();
using var observedFrame = client.State.Reactive<AetheriaRuntimeDaemonFrameDocument>();
using var observedSoaView = client.State.Reactive<AetheriaRuntimeDaemonSoaViewDocument>();
using var observedZoneRender = client.State.Reactive<AetheriaRuntimeZoneRenderDocument>();
var observed = AetheriaRuntimeObservedDaemonState.TryCreateCurrent(
observedFrame,
observedSoaView,

View file

@ -1552,7 +1552,7 @@ private void Update()
{
_loadoutFrame = ResolveClient()
.State
.ReactiveDaemonFrame();
.Reactive<AetheriaRuntimeDaemonFrameDocument>();
}
catch (Exception ex)
{