From b018165e3c99915628ac7ed29fef6425137a15a6 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Fri, 14 Jun 2024 19:25:48 +0800 Subject: [PATCH] =?UTF-8?q?Remove=20ambiguous=20comments.=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=9C=89=E6=AD=A7=E4=B9=89=E7=9A=84=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/inventory/ItemSlotNode.cs | 1 - scripts/item/IItem.cs | 4 ---- scripts/item/itemStacks/IItemStack.cs | 4 ++++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/inventory/ItemSlotNode.cs b/scripts/inventory/ItemSlotNode.cs index 5425825..b1fa2b6 100644 --- a/scripts/inventory/ItemSlotNode.cs +++ b/scripts/inventory/ItemSlotNode.cs @@ -12,7 +12,6 @@ namespace ColdMint.scripts.inventory; /// public partial class ItemSlotNode : MarginContainer { - //private IItem? _item; private IItemStack? _itemStack; private TextureRect? _backgroundTextureRect; private TextureRect? _iconTextureRect; diff --git a/scripts/item/IItem.cs b/scripts/item/IItem.cs index c0cafbe..d155aa0 100644 --- a/scripts/item/IItem.cs +++ b/scripts/item/IItem.cs @@ -71,10 +71,6 @@ public interface IItem /// 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; } \ No newline at end of file diff --git a/scripts/item/itemStacks/IItemStack.cs b/scripts/item/itemStacks/IItemStack.cs index 5ba7d17..5437473 100644 --- a/scripts/item/itemStacks/IItemStack.cs +++ b/scripts/item/itemStacks/IItemStack.cs @@ -159,6 +159,10 @@ public interface IItemStack /// Create a new ItemStack with the given item as the first item /// 以给定的物品为第一个物品创建物品堆 /// + /// + ///Assuming the item implements the method, then use the return value of the SpecialStack method, otherwise extrapolate from the maximum number of stacks of items. + ///假设物品实现了方法,那么使用SpecialStack方法的返回值,否则根据物品的最大堆叠数量来推断。 + /// public static IItemStack FromItem(IItem item) => item.SpecialStack() ?? ItemTypeManager.MaxStackQuantityOf(item.Id) switch