Add Unity runtime catalog facade

This commit is contained in:
Meta Vens 2026-06-13 09:15:59 +01:00
commit 3818670e48
9 changed files with 418 additions and 1 deletions

View file

@ -0,0 +1,40 @@
using Aetheria.State.Documents;
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").ConfigureAwait(false);
return new AetheriaRuntimeCatalogClient(node);
}
public AetheriaRuntimeCatalogSnapshot ReadCatalog()
{
var catalog = _node.ReadCatalogSnapshot();
return AetheriaRuntimeCatalogSnapshot.FromCatalog(catalog);
}
public async Task<EveSurfaceState?> ReadCatalogSurfaceAsync()
{
return await _node.GetCatalogSurfaceAsync().ConfigureAwait(false);
}
public ValueTask DisposeAsync()
{
return _node.DisposeAsync();
}
public void Dispose()
{
_node.Dispose();
}
}