using UnityEngine; namespace Ashwild.Storage { /// /// Authoring data for one kind of storage chest: how many slots it holds, the title shown at the /// top of its window, and how wide the grid is laid out. Follows the SO-for-data / /// MonoBehaviour-for-logic split (like ItemData / BuildableData) — a small chest and a large chest /// are two assets of this type dropped on two Chest prefabs, with no code change. /// [CreateAssetMenu(fileName = "NewChestData", menuName = "Storage/Chest Data")] public class ChestData : ScriptableObject { #region Serialized Fields [Header("Identity")] [Tooltip("Title shown at the top of the chest window.")] [SerializeField] private string displayName = "Coffre"; [Header("Layout")] [Tooltip("Total number of storage slots this chest holds.")] [SerializeField] private int slotCount = 20; [Tooltip("How many slots per row the chest grid is laid out with (used by the UI layout).")] [SerializeField] private int columns = 5; #endregion #region Public API public string DisplayName => displayName; /// /// Number of storage slots, clamped to at least one so a misconfigured asset never seeds an /// empty, unusable chest. /// public int SlotCount => Mathf.Max(1, slotCount); /// /// Slots per row for the grid layout, clamped to at least one. /// public int Columns => Mathf.Max(1, columns); #endregion } }