Aetheria/Aetheria.State.Unity/AetheriaRuntimeCatalogClient.cs

43 lines
1 KiB
C#
Raw Normal View History

2026-06-13 09:15:59 +01:00
using Aetheria.State.Documents;
2026-06-21 09:54:15 +01:00
using GameCult.Aetheria.State.Verse;
using GameCult.Mesh;
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
}
public EveSurfaceState? 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();
}
}