using Entitas;
using JNGame.Sync.System;
using NotImplementedException = System.NotImplementedException;

namespace JNGame.Sync.Entity.Component
{
    /// <summary>
    /// 组件
    /// </summary>
    public class JNComponent : IComponent,IJNSyncCycle
    {
        
        public IJNEntity Entity;
        
        public void OnInit(IJNEntity entity)
        {
            this.Entity = entity;
        }
        
        public T GetSystem<T>() where T : SLogicSystem
        {
            return Entity.GetContext().GetSync().GetSystem<T>();
        }
        
        //生命周期
        public virtual void OnSyncStart(){}
        public virtual void OnSyncUpdate(int dt){}
        public virtual void OnSyncDestroy(){}
    }
}