using System; using Godot; namespace ColdMint.scripts.item; public readonly struct ItemType(string id, Func newItemFunc, Texture2D? icon, int maxStackQuantity) { /// /// Item id of this type /// 该类型物品的id /// public string Id { get; init; } = id; /// /// A function returns a new item instance of this type /// 用于创建该类型的物品实例的函数 /// public Func NewItemFunc { get; init; } = newItemFunc; /// /// Default icon of items of this type /// 该类型物品的默认图标 /// public Texture2D? Icon { get; init; } = icon; /// /// Max number in item stack of this type /// 该类型物品的最大堆叠数量 /// public int MaxStackQuantity { get; init; } = maxStackQuantity; }