2024-06-21 11:16:40 +00:00
|
|
|
|
using Godot;
|
2024-06-10 15:08:48 +00:00
|
|
|
|
|
2024-06-22 11:21:06 +00:00
|
|
|
|
namespace ColdMint.scripts.inventory;
|
2024-06-10 15:08:48 +00:00
|
|
|
|
|
2024-06-12 19:07:55 +00:00
|
|
|
|
public interface IItem
|
2024-06-10 15:08:48 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>ID of current item</para>
|
2024-06-13 14:29:18 +00:00
|
|
|
|
/// <para>当前项目的ID</para>
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
string Id { get; }
|
2024-06-21 11:16:40 +00:00
|
|
|
|
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Icon of current item</para>
|
2024-06-13 14:29:18 +00:00
|
|
|
|
/// <para>当前项目的图标</para>
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
Texture2D Icon { get; }
|
2024-06-21 11:16:40 +00:00
|
|
|
|
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Display name of current item</para>
|
2024-06-13 14:29:18 +00:00
|
|
|
|
/// <para>显示当前Item的名称</para>
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
string Name { get; }
|
2024-06-21 11:16:40 +00:00
|
|
|
|
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Description of current item, which may show in inventory</para>
|
2024-06-13 14:29:18 +00:00
|
|
|
|
/// <para>当前项目的描述</para>
|
2024-06-10 15:08:48 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
string? Description { get; }
|
2024-06-21 11:16:40 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Quantity</para>
|
|
|
|
|
/// <para>当前的数量</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
int Quantity { get; set; }
|
|
|
|
|
|
2024-06-16 10:41:26 +00:00
|
|
|
|
/// <summary>
|
2024-06-21 11:16:40 +00:00
|
|
|
|
/// <para>MaxItemQuantity</para>
|
|
|
|
|
/// <para>最大物品数量</para>
|
2024-06-16 10:41:26 +00:00
|
|
|
|
/// </summary>
|
2024-06-21 11:16:40 +00:00
|
|
|
|
int MaxQuantity { get; }
|
2024-06-11 17:57:55 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>Execute when current item is used <br/> e.g. when player clicks left mouse button with current item in hand</para>
|
2024-06-13 14:29:18 +00:00
|
|
|
|
/// <para>当前项被使用时执行 <br/> e.g. 当玩家用鼠标左键点击当前物品时</para>
|
2024-06-11 17:57:55 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="owner">Owner of current item, if any</param>
|
|
|
|
|
/// <param name="targetGlobalPosition">Target position, such as the position of the cursor when used by the player</param>
|
|
|
|
|
void Use(Node2D? owner, Vector2 targetGlobalPosition);
|
2024-06-10 15:08:48 +00:00
|
|
|
|
}
|