提交示例代码

This commit is contained in:
Bob.Song
2026-03-05 11:39:06 +08:00
commit 25958f58c3
2534 changed files with 209593 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
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);
}