namespace XGame.Editor.Asset.Tools
{
    public interface IReorderableHandler
    {
        /// <summary>
        /// 标题名字
        /// </summary>
        string HeaderName { get; }
        /// <summary>
        /// 标题的 toolTip
        /// </summary>
        string HeaderTooltip { get; }
        /// <summary>
        /// Handler持有的数据总数
        /// </summary>
        int DataCount { get; }
        /// <summary>
        /// 创建IReorderableItem
        /// </summary>
        /// <param name="isInit">true:根据Handler持有的数据创建，false:新增一个全新的Item</param>
        /// <param name="index"></param>
        /// <returns></returns>
        IReorderableItem CreateItem(bool isInit, int index);
        /// <summary>
        /// 删除item
        /// </summary>
        /// <param name="index"></param>
        void RemoveItem(int index);
        /// <summary>
        /// item交换索引
        /// </summary>
        /// <param name="oldIndex"></param>
        /// <param name="newIndex"></param>
        void ItemChangedIndex(int oldIndex, int newIndex);
        /// <summary>
        /// 是否能够增加Item
        /// 对当前索引有效
        /// </summary>
        /// <param name="count"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        bool IsCanAdd(int count, int index);
        /// <summary>
        /// 是否能够删除Item
        /// 对当前索引有效
        /// </summary>
        /// <param name="count"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        bool IsCanRemove(int count, int index);
        
    }
}

