Use generic reactive daemon documents
This commit is contained in:
parent
bbb86e72e4
commit
0e694abe9a
7 changed files with 54 additions and 81 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1552,7 +1552,7 @@ private void Update()
|
|||
{
|
||||
_loadoutFrame = ResolveClient()
|
||||
.State
|
||||
.ReactiveDaemonFrame();
|
||||
.Reactive<AetheriaRuntimeDaemonFrameDocument>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue