using Luban;
using MrWu;
using Server.Core;

namespace Server
{
    public interface IConfigSingleton
    {
        void LoadData(byte[] data);
    }

    public abstract class ConfigSingleton<T> : SingleInstance<T>,IConfigSingleton where T : ConfigSingleton<T>,new()
    {
        /// <summary>
        /// 重新加载
        /// </summary>
        public abstract void ReLoadData();
        
        public void LoadData(byte[] data)
        {
            LoadData(new ByteBuf(data));
        }

        protected abstract void LoadData(ByteBuf _buf);
    }
}