namespace Stary.Evo
{
    public interface IData: IBelongToArchitecture,ICanSetArchitecture,ICanGetUtility ,ICanSendEvent
    {
        void Init();
        void Dispose();
    }
    
    public abstract class AbstractData : IData
    {
        private IArchitecture mArchitecture;
        //接口阉割，子类重写无法用子类调用
        IArchitecture IBelongToArchitecture.GetArchitecture()
        {
            return mArchitecture;
        }

        void ICanSetArchitecture.SetArchitecture(IArchitecture architecture)
        {
            mArchitecture = architecture;
        }

        void IData.Init()
        {
            OnInit();
        }

        public abstract void Dispose();

        //数据初始化
        protected abstract void OnInit();

    }
}