acdream/src/AcDream.Runtime/Chat/ICommandBus.cs

24 lines
915 B
C#

namespace AcDream.Runtime.Chat;
/// <summary>
/// Publishes user-intent commands from panels to the systems that handle
/// them (WorldSession, ChatService, Inventory, ...). Panels never touch
/// those systems directly — they <see cref="Publish{T}(T)"/> a record
/// and the bus dispatches.
///
/// <para>
/// D.2a scaffolding: <see cref="NullCommandBus"/> is the default wire-up
/// — commands are accepted but dropped. Real routing lands alongside
/// chat and inventory (Sprint 2 of the UI plan) when we actually need
/// commands flowing server-ward.
/// </para>
/// </summary>
public interface ICommandBus
{
/// <summary>
/// Publish a command record. The bus routes by runtime type via
/// registered handlers. Never blocks; handlers run on the publish
/// thread today (render thread for panel-triggered commands).
/// </summary>
void Publish<T>(T command) where T : notnull;
}