using System;
using Cthangover.CardBattle.UI;
namespace Cthangover.CardBattle
{
///
/// Static sink for battle journal entries. Player action strategies and
/// the battle core run without a reference to the UI screen, so they
/// publish here instead of reaching into the scene tree; the
/// subscribes while it exists and unsubscribes
/// on tree exit, which keeps the hub empty outside of a battle. This is the
/// same service-locator pattern the battle code already uses for
/// ActionExecutorHub and ShowDamageBehaviour.
///
public static class BattleLogHub
{
/// Fired for every entry; handlers receive the text and its kind.
public static event Action Entry;
/// Publishes one journal row. No-op when no battle UI is listening.
public static void Log(string text, BattleLogKind kind = BattleLogKind.Info)
=> Entry?.Invoke(text, kind);
}
}