Files
2026-03-05 11:39:06 +08:00

34 lines
996 B
C#
Raw Permalink 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 Fantasy;
namespace Fantasy;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true,Inherited = false)]
public sealed class ItemUseAttribute : Attribute
{
public ItemUseEffect Type { get; }
public ItemUseAttribute(ItemUseEffect type)
{
Type = type;
}
}
public interface IItemUse
{
/// <summary>
/// 正常的情况下应该是使用Unit,因为这个代表的是某一个单位。
/// 由于课程中没有这个Unit所以暂时用Account来代替。
/// </summary>
/// <param name="account"></param>
/// <param name="config"></param>
/// <param name="count"></param>
/// <returns></returns>
uint CanUse(Account account, ItemConfig config, ref int count);
/// <summary>
/// 使用物品的逻辑。
/// </summary>
/// <param name="account"></param>
/// <param name="config"></param>
/// <param name="count"></param>
void Use(Account account, ItemConfig config, ref int count);
}