Add native reactive client state access
This commit is contained in:
parent
e15eb1b22b
commit
296a0b6de8
26 changed files with 258 additions and 244 deletions
|
|
@ -95,7 +95,7 @@ public abstract class ActionBarBinding : IDisposable
|
|||
|
||||
try
|
||||
{
|
||||
_catalog ??= Client.State.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
|
||||
_catalog ??= Client.State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
return _catalog?.Current?.FindItem(item, x => x.ItemKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour
|
|||
return;
|
||||
}
|
||||
|
||||
_daemonFrame ??= state.Document<AetheriaRuntimeDaemonFrameDocument>().Reactive();
|
||||
_daemonFrame ??= state.Reactive<AetheriaRuntimeDaemonFrameDocument>();
|
||||
_daemonSoaView ??= TryReactive<AetheriaRuntimeDaemonSoaViewDocument>(state);
|
||||
_zoneRender ??= state.Document<AetheriaRuntimeZoneRenderDocument>().Reactive();
|
||||
_zoneRender ??= state.Reactive<AetheriaRuntimeZoneRenderDocument>();
|
||||
}
|
||||
|
||||
private static CultMeshReactiveDocument<TDocument> TryReactive<TDocument>(
|
||||
|
|
@ -142,7 +142,7 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return state.Document<TDocument>().Reactive();
|
||||
return state.Reactive<TDocument>();
|
||||
}
|
||||
catch (System.Collections.Generic.KeyNotFoundException)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ public sealed class AetheriaUnityGameplayBootShell
|
|||
|
||||
var aetheria = AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)
|
||||
.State;
|
||||
using var runtimeCatalogDocument = aetheria.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
|
||||
using var runtimeCatalogDocument = aetheria.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
var runtimeCatalog = runtimeCatalogDocument.Current;
|
||||
if (runtimeCatalog == null)
|
||||
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
|
||||
using var sectorMapDocument = aetheria.Document<AetheriaRuntimeSectorMapDocument>().Reactive();
|
||||
using var sectorMapDocument = aetheria.Reactive<AetheriaRuntimeSectorMapDocument>();
|
||||
var sectorMap = sectorMapDocument.Current;
|
||||
if (sectorMap == null)
|
||||
throw new InvalidOperationException("Aetheria typed sector map is required before gameplay boot.");
|
||||
|
|
|
|||
|
|
@ -212,9 +212,9 @@ public sealed class AetheriaUnityObservedDockingIndex : IDisposable
|
|||
if (state == null)
|
||||
return;
|
||||
|
||||
_currentEntity ??= state.Document<AetheriaRuntimeCurrentEntityDocument>().Reactive();
|
||||
_currentDocking ??= state.Document<AetheriaRuntimeCurrentDockingDocument>().Reactive();
|
||||
_stationRefit ??= state.Document<AetheriaRuntimeStationRefitDocument>().Reactive();
|
||||
_currentEntity ??= state.Reactive<AetheriaRuntimeCurrentEntityDocument>();
|
||||
_currentDocking ??= state.Reactive<AetheriaRuntimeCurrentDockingDocument>();
|
||||
_stationRefit ??= state.Reactive<AetheriaRuntimeStationRefitDocument>();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public sealed class AetheriaUnityObservedTargetQuery : IDisposable
|
|||
try
|
||||
{
|
||||
_zoneContacts = _resolveClient()
|
||||
?.State.Document<AetheriaRuntimeZoneContactsDocument>().Reactive();
|
||||
?.State.Reactive<AetheriaRuntimeZoneContactsDocument>();
|
||||
return _zoneContacts?.Current;
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
|
|
@ -117,9 +117,7 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
try
|
||||
{
|
||||
var nextRenderSplatsViewport = ResolveClient()
|
||||
.State
|
||||
.Document<AetheriaRuntimeRenderSplatsViewportDocument>(viewport)
|
||||
.Reactive();
|
||||
.State.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport);
|
||||
ClearViewportDocument();
|
||||
_viewport = viewport;
|
||||
_renderSplatsViewport = nextRenderSplatsViewport;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
try
|
||||
{
|
||||
_playerSettingsDocument ??= ResolveClient(AetheriaUnityRuntimePaths.RuntimeStateFilePath)
|
||||
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
|
||||
var stored = _playerSettingsDocument.Current;
|
||||
if (stored == null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue