Aetheria/Aetheria.State.Unity/AetheriaRuntimeCatalogClient.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2026-06-21 09:54:15 +01:00
using GameCult.Aetheria.State.Verse;
using GameCult.Mesh;
2026-07-01 15:26:48 +01:00
using EveSurfaceDocument = GameCult.Eve.Surface.EveSurfaceDocument;
2026-06-13 09:15:59 +01:00
namespace Aetheria.State.Unity;
public sealed class AetheriaRuntimeCatalogClient : IAsyncDisposable, IDisposable
{
private readonly AetheriaStateNode _node;
private AetheriaRuntimeCatalogClient(AetheriaStateNode node)
{
_node = node;
}
public static async Task<AetheriaRuntimeCatalogClient> OpenAsync(string statePath)
{
var node = await AetheriaStateNode
.OpenAsync(statePath, "aetheria-unity-runtime-catalog", enableDurableShardLogs: false)
.ConfigureAwait(false);
2026-06-13 09:15:59 +01:00
return new AetheriaRuntimeCatalogClient(node);
}
public AetheriaRuntimeCatalogSnapshot ReadCatalog()
{
return _node.RuntimeCatalog().Latest();
2026-06-13 09:15:59 +01:00
}
2026-07-01 12:54:12 +01:00
public EveSurfaceDocument? ReadCatalogSurface()
2026-06-13 09:15:59 +01:00
{
return _node.CatalogSurface().Latest();
2026-06-13 09:15:59 +01:00
}
public ValueTask DisposeAsync()
{
return _node.DisposeAsync();
}
public void Dispose()
{
_node.Dispose();
}
}