Read daemon Eve surfaces through typed documents
This commit is contained in:
parent
3f1be900e7
commit
29ea52722c
2 changed files with 12 additions and 9 deletions
|
|
@ -648,14 +648,16 @@ static async Task InjectEveSurfaceSnapshotAsync(
|
|||
|
||||
static Task<EveSurfaceState?> ReadEveSurfacePublicationAsync(AetheriaStateNode node, string surfaceKind)
|
||||
{
|
||||
return surfaceKind switch
|
||||
var key = surfaceKind switch
|
||||
{
|
||||
"game" => node.GetDaemonGameSurfaceAsync(),
|
||||
"game-tui" => node.GetDaemonGameTuiSurfaceAsync(),
|
||||
"editor" => node.GetDaemonEditorSurfaceAsync(),
|
||||
"editor-tui" => node.GetDaemonEditorTuiSurfaceAsync(),
|
||||
"game" => AetheriaRuntimeVerseRecordKeys.DaemonGameSurface,
|
||||
"game-tui" => AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface,
|
||||
"editor" => AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface,
|
||||
"editor-tui" => AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(surfaceKind), surfaceKind, "Unknown Eve surface publication.")
|
||||
};
|
||||
|
||||
return LatestOrDefaultAsync(node.Document<EveSurfaceState>(key));
|
||||
}
|
||||
|
||||
static async Task RunRtsCultMeshPumpAsync(
|
||||
|
|
|
|||
|
|
@ -8993,10 +8993,11 @@ static void RequireDaemonVersePublication(string root)
|
|||
"LatestOrDefaultAsync(",
|
||||
"InjectEveSurfaceSnapshotAsync(",
|
||||
"ReadEveSurfacePublicationAsync(",
|
||||
"node.GetDaemonGameSurfaceAsync()",
|
||||
"node.GetDaemonGameTuiSurfaceAsync()",
|
||||
"node.GetDaemonEditorSurfaceAsync()",
|
||||
"node.GetDaemonEditorTuiSurfaceAsync()",
|
||||
"AetheriaRuntimeVerseRecordKeys.DaemonGameSurface",
|
||||
"AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface",
|
||||
"AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface",
|
||||
"AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface",
|
||||
"LatestOrDefaultAsync(node.Document<EveSurfaceState>(key))",
|
||||
"AetheriaEveCommandBridge.AcceptObservedAsync(",
|
||||
"ReadObservedDaemonCommands()",
|
||||
"currentFrame?.AccountedCommandIds ?? Array.Empty<string>()",
|
||||
|
|
|
|||
Loading…
Reference in a new issue