using ColdMint.scripts.item.itemStacks;
using Godot;
namespace ColdMint.scripts.item;
public interface IItem
{
///
/// ID of current item
///
string Id { get; }
///
/// Icon of current item
///
Texture2D Icon { get; }
///
/// Display name of current item
///
string Name { get; }
///
/// Description of current item, which may show in inventory
///
string? Description { get; }
///
/// Execute when current item is used
e.g. when player clicks left mouse button with current item in hand
///
/// Owner of current item, if any
/// Target position, such as the position of the cursor when used by the player
void Use(Node2D? owner, Vector2 targetGlobalPosition);
///
/// Execute when current item be removed from game.
///
void Destroy();
///
/// Return true if this item can be stacked with the given item in one stack
/// 若该物品是否能与给定物品堆叠在同一个物品堆上,返回true
///
///
///
/// ! Note in the implementation: the correspondence of this predicate must be an equivalence relation over the full set of stackable items
/// (i.e., be able to derive a division into the full set of stackable items).
/// Or if the item is not stackable, make it always return false.
///
///
/// !实现时注意:该谓词的对应关系必须是在全部可堆叠的物品集合上的等价关系(即能导出一个对可堆叠物品全集的划分)。
/// 或如果该物品不可堆叠,令其永远返回false。
///
///
/// If it is necessary to implement special stacking relationships (e.g. containers that can be stacked to hold items),
/// customize the special type, implement the special stacking determination in it by overriding ,
/// and override the method so that it returns an instance of that custom ItemStack.
///
///
/// 如果有必要实现特殊的堆叠关系(如可以用堆叠来收纳物品的容器),请自定义特殊的类型,在其中重写以实现特殊的堆叠判定,
/// 并重写方法使其返回该自定义ItemStack实例。
///
///
bool CanStackWith(IItem item);
///
/// If this item need a special stack type, return the special item stack instance that contains the item. If else, just leave this null.
/// 如果该项目需要特殊的物品堆类型,重写此方法来返回包含该物品的特殊物品堆实例。否则,保留原本的null返回值。
///
///
/// DO NOT use this method to create stack from item, use instead
/// **不要**使用此方法从一个物品创建堆,请使用 。
///
///
IItemStack? SpecialStack() => null;
}