45 lines
1.8 KiB
C#
45 lines
1.8 KiB
C#
// src/AcDream.Plugin.Abstractions/IPluginHost.cs
|
|
namespace AcDream.Plugin.Abstractions;
|
|
|
|
/// <summary>
|
|
/// Entry point for a plugin into the acdream runtime. The surface will grow
|
|
/// across phases as more systems come online.
|
|
/// </summary>
|
|
public interface IPluginHost
|
|
{
|
|
/// <summary>
|
|
/// <see langword="true"/> when <see cref="Ui"/> registrations can be
|
|
/// projected by this host. No-window hosts return <see langword="false"/>
|
|
/// and expose <see cref="NoOpUiRegistry.Instance"/> so a plugin may keep
|
|
/// one code path while deliberately omitting presentation work.
|
|
/// </summary>
|
|
bool HasUi { get; }
|
|
|
|
IPluginLogger Log { get; }
|
|
IGameState State { get; }
|
|
IEvents Events { get; }
|
|
ISelectionService Selection { get; }
|
|
IUiRegistry Ui { get; }
|
|
/// <summary>
|
|
/// Locally handled slash/at commands. Hosts without command routing expose
|
|
/// an inert registry so an API-v1 plugin can retain one code path.
|
|
/// </summary>
|
|
IPluginCommandRegistry Commands => NoOpPluginCommandRegistry.Instance;
|
|
/// <summary>
|
|
/// Durable storage scoped by the host to this plugin's manifest id.
|
|
/// No-window/test hosts may explicitly expose the inert implementation.
|
|
/// </summary>
|
|
IPluginStorage Storage => NoOpPluginStorage.Instance;
|
|
/// <summary>Unload-safe external VTank-style loot classifiers.</summary>
|
|
IPluginLootClassifierRegistry LootClassifiers =>
|
|
NoOpPluginLootClassifierRegistry.Instance;
|
|
|
|
/// <summary>
|
|
/// Character reads, spell data and casting. Hosts with no live session
|
|
/// expose <see cref="NoOpAutomationSurface.Instance"/>, so a plugin may
|
|
/// hold one code path and check
|
|
/// <see cref="IAutomationSurface.IsAvailable"/> rather than branching on
|
|
/// host kind.
|
|
/// </summary>
|
|
IAutomationSurface Automation { get; }
|
|
}
|