Traveller/scripts/item/IItem.cs

50 lines
1.5 KiB
C#
Raw Normal View History

using Godot;
2024-06-10 15:08:48 +00:00
namespace ColdMint.scripts.item;
public interface IItem
2024-06-10 15:08:48 +00:00
{
/// <summary>
/// <para>ID of current item</para>
/// <para>当前项目的ID</para>
2024-06-10 15:08:48 +00:00
/// </summary>
string Id { get; }
2024-06-10 15:08:48 +00:00
/// <summary>
/// <para>Icon of current item</para>
/// <para>当前项目的图标</para>
2024-06-10 15:08:48 +00:00
/// </summary>
Texture2D Icon { get; }
2024-06-10 15:08:48 +00:00
/// <summary>
/// <para>Display name of current item</para>
/// <para>显示当前Item的名称</para>
2024-06-10 15:08:48 +00:00
/// </summary>
string Name { get; }
2024-06-10 15:08:48 +00:00
/// <summary>
/// <para>Description of current item, which may show in inventory</para>
/// <para>当前项目的描述</para>
2024-06-10 15:08:48 +00:00
/// </summary>
string? Description { get; }
/// <summary>
/// <para>Quantity</para>
/// <para>当前的数量</para>
/// </summary>
int Quantity { get; set; }
2024-06-16 10:41:26 +00:00
/// <summary>
/// <para>MaxItemQuantity</para>
/// <para>最大物品数量</para>
2024-06-16 10:41:26 +00:00
/// </summary>
int MaxQuantity { get; }
/// <summary>
/// <para>Execute when current item is used <br/> e.g. when player clicks left mouse button with current item in hand</para>
/// <para>当前项被使用时执行 <br/> e.g. 当玩家用鼠标左键点击当前物品时</para>
/// </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
}