Files
zeling_v2/Assets/_Game/Scripts/Spells/ISpellService.cs
2026-05-25 11:54:37 +08:00

27 lines
940 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
namespace BaseGames.Spells
{
/// <summary>
/// 法术管理服务接口。UI 层SpellSlotWidget通过此接口读取法术状态
/// 与 SpellManager 具体实现解耦,支持测试场景下的 Mock 替换。
/// </summary>
public interface ISpellService
{
/// <summary>当前装备的法术null 表示未装备。</summary>
SpellSO EquippedSpell { get; }
/// <summary>冷却进度0 = 就绪1 = 刚施放)。</summary>
float CooldownFraction { get; }
/// <summary>法术当前是否可施放(已装备且冷却完毕)。</summary>
bool IsReady { get; }
/// <summary>
/// 法术装备或卸下时触发。参数为新法术null 表示已卸下。
/// UI 订阅此事件可实现零延迟的图标刷新,无需轮询。
/// </summary>
event Action<SpellSO> OnSpellChanged;
}
}