Add named Eve surface document access
This commit is contained in:
parent
9ed5bd25c9
commit
8a1f981f97
4 changed files with 72 additions and 31 deletions
|
|
@ -3213,14 +3213,10 @@ static void RequireEveRuntimeBootstrap(string root)
|
|||
{
|
||||
"private string surfaceId = AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId",
|
||||
"ReadDaemonSurface(stateBoot)",
|
||||
"AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(",
|
||||
"AetheriaUnityRuntimeClientProvider.ReactiveEveSurface(",
|
||||
"AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(",
|
||||
"CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>",
|
||||
"ResolveReactiveDaemonSurfaceState(",
|
||||
"AetheriaClientEveSurface.Game",
|
||||
"AetheriaClientEveSurface.GameTui",
|
||||
"AetheriaClientEveSurface.Editor",
|
||||
"AetheriaClientEveSurface.EditorTui",
|
||||
"DisposeReactiveSurfaceState()",
|
||||
"AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(",
|
||||
"private bool ShouldMountSurface(",
|
||||
|
|
@ -3273,6 +3269,7 @@ static void RequireEveRuntimeBootstrap(string root)
|
|||
|
||||
if (presenter.Contains("ResolveClient(", StringComparison.Ordinal) ||
|
||||
presenter.Contains("AetheriaRuntimeDaemonSurfaceCommands.TrySubmit(", StringComparison.Ordinal) ||
|
||||
presenter.Contains("AetheriaClientEveSurface.", StringComparison.Ordinal) ||
|
||||
presenter.Contains("client.State.", StringComparison.Ordinal) ||
|
||||
presenter.Contains("client.Ui.", StringComparison.Ordinal))
|
||||
{
|
||||
|
|
@ -8330,6 +8327,9 @@ static void RequireAetheriaManagedStateAccessorsCoverDomainDocuments(string root
|
|||
{
|
||||
"public CultMeshDocumentHandle<TDocument> Document<TDocument>()",
|
||||
"public enum AetheriaClientEveSurface",
|
||||
"public static bool TryResolveEveSurface(",
|
||||
"public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState>? EveSurfaceDocument(",
|
||||
"public CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? ReactiveEveSurface(",
|
||||
"public CultMeshDocumentHandle<TDocument> Document<TDocument>(AetheriaClientEveSurface surface)",
|
||||
"public CultMeshDocumentHandle<TDocument> Document<TDocument>(AetheriaRuntimeRtsViewportBounds viewport)",
|
||||
"public CultMeshDocumentHandle<TDocument> Document<TDocument>(int index)",
|
||||
|
|
@ -16343,6 +16343,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(string runtimeId = \"\")",
|
||||
"public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(",
|
||||
"AetheriaClientEveSurface surface",
|
||||
"public static CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState> ReactiveEveSurface(",
|
||||
"public static CultMeshStateRefResolver EveSurfaceStateRefResolver(string runtimeId = \"\")",
|
||||
"public static CultMeshStateRefResolver EveSurfaceStateRefResolver(",
|
||||
"private static readonly Dictionary<string, AetheriaClient> RuntimeClients",
|
||||
|
|
@ -16900,7 +16901,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
string.Join(", ", mainMenuReaderHits));
|
||||
}
|
||||
|
||||
if (!eveSurfacePresenter.Contains("AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(", StringComparison.Ordinal) ||
|
||||
if (!eveSurfacePresenter.Contains("AetheriaUnityRuntimeClientProvider.ReactiveEveSurface(", StringComparison.Ordinal) ||
|
||||
!eveSurfacePresenter.Contains("ReadDaemonSurface(stateBoot)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
|
|
|
|||
|
|
@ -136,6 +136,21 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return RuntimeState(stateBoot, runtimeId).Reactive<TDocument>(surface);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState> ReactiveEveSurface(
|
||||
string surfaceId,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactiveEveSurface(surfaceId);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState> ReactiveEveSurface(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string surfaceId,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).ReactiveEveSurface(surfaceId);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(
|
||||
AetheriaRuntimeRtsViewportBounds viewport,
|
||||
string runtimeId = "")
|
||||
|
|
|
|||
|
|
@ -170,31 +170,10 @@ namespace GameCult.Aetheria.EveRuntime
|
|||
private CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? CreateReactiveDaemonSurfaceState(
|
||||
AetheriaRuntimeStateBootReport stateBoot)
|
||||
{
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, StringComparison.Ordinal))
|
||||
return AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(
|
||||
stateBoot,
|
||||
AetheriaClientEveSurface.Game,
|
||||
"unity-eve-surface-presenter");
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonGameSurfaceBuilder.TuiSurfaceId, StringComparison.Ordinal))
|
||||
return AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(
|
||||
stateBoot,
|
||||
AetheriaClientEveSurface.GameTui,
|
||||
"unity-eve-surface-presenter");
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, StringComparison.Ordinal))
|
||||
return AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(
|
||||
stateBoot,
|
||||
AetheriaClientEveSurface.Editor,
|
||||
"unity-eve-surface-presenter");
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, StringComparison.Ordinal))
|
||||
return AetheriaUnityRuntimeClientProvider.Reactive<global::Aetheria.State.Documents.EveSurfaceState>(
|
||||
stateBoot,
|
||||
AetheriaClientEveSurface.EditorTui,
|
||||
"unity-eve-surface-presenter");
|
||||
|
||||
return null;
|
||||
return AetheriaUnityRuntimeClientProvider.ReactiveEveSurface(
|
||||
stateBoot,
|
||||
surfaceId,
|
||||
"unity-eve-surface-presenter");
|
||||
}
|
||||
|
||||
private UIDocument ResolveDocument()
|
||||
|
|
|
|||
|
|
@ -193,6 +193,52 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return Document<TDocument>().Reactive();
|
||||
}
|
||||
|
||||
public static bool TryResolveEveSurface(
|
||||
string? surfaceId,
|
||||
out AetheriaClientEveSurface surface)
|
||||
{
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, StringComparison.Ordinal))
|
||||
{
|
||||
surface = AetheriaClientEveSurface.Game;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonGameSurfaceBuilder.TuiSurfaceId, StringComparison.Ordinal))
|
||||
{
|
||||
surface = AetheriaClientEveSurface.GameTui;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, StringComparison.Ordinal))
|
||||
{
|
||||
surface = AetheriaClientEveSurface.Editor;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.Equals(surfaceId, AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, StringComparison.Ordinal))
|
||||
{
|
||||
surface = AetheriaClientEveSurface.EditorTui;
|
||||
return true;
|
||||
}
|
||||
|
||||
surface = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState>? EveSurfaceDocument(
|
||||
string? surfaceId)
|
||||
{
|
||||
return TryResolveEveSurface(surfaceId, out var surface)
|
||||
? Document<global::Aetheria.State.Documents.EveSurfaceState>(surface)
|
||||
: null;
|
||||
}
|
||||
|
||||
public CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? ReactiveEveSurface(
|
||||
string? surfaceId)
|
||||
{
|
||||
return EveSurfaceDocument(surfaceId)?.Reactive();
|
||||
}
|
||||
|
||||
public CultMeshDocumentHandle<TDocument> Document<TDocument>(AetheriaClientEveSurface surface)
|
||||
where TDocument : class
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue