using System; using Godot; namespace ColdMint.scripts.item; public interface IItemStack { /// /// ID of items inside current stack /// string Id { get; } /// /// Max number of current stack /// int MaxQuantity { get; } /// /// Quantity of current stack /// int Quantity { 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; } /// /// Create a new ItemStack with the given item as the first item /// public static IItemStack? FromItem(IItem_New item) => ItemTypeManager.StackTypeOf(item.Id) switch { StackType.Common => throw new NotImplementedException(), StackType.Unique => throw new NotImplementedException(), StackType.Unstackable => new SingleItemStack(item), null => null, _ => throw new ArgumentException() }; }