2024-04-28 13:55:19 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
namespace ColdMint.scripts.inventory;
|
|
|
|
|
|
|
|
|
|
public interface IItem
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Item and ID</para>
|
|
|
|
|
/// <para>物品还有ID</para>
|
|
|
|
|
/// </summary>
|
2024-04-29 15:25:03 +00:00
|
|
|
|
string Id { get; set; }
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Represents the quantity of this item</para>
|
|
|
|
|
/// <para>表示此物品的数量</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
int Quantity { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>How many can this item stack up to</para>
|
|
|
|
|
/// <para>这个物品最多叠加到多少个</para>
|
|
|
|
|
/// </summary>
|
2024-04-29 15:25:03 +00:00
|
|
|
|
int MaxStackQuantity { get; set; }
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Items can be set with Icon</para>
|
|
|
|
|
/// <para>物品可以设置图标</para>
|
|
|
|
|
/// </summary>
|
2024-04-29 15:25:03 +00:00
|
|
|
|
Texture2D Icon { get; set; }
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Item has a name</para>
|
|
|
|
|
/// <para>物品有名称</para>
|
|
|
|
|
/// </summary>
|
2024-04-29 15:25:03 +00:00
|
|
|
|
string Name { get; set; }
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>When using items</para>
|
|
|
|
|
/// <para>当使用物品时</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
Action<IItem> OnUse { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>When removing items from the backpack, instantiate them</para>
|
|
|
|
|
/// <para>当从背包内取出,实例化物品时</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
Func<IItem, Node> OnInstantiation { get; set; }
|
|
|
|
|
}
|