namespace XGame.Framework.Map
{
    public abstract class EntityController<TViewModel> : IEntityController, IMapContextSetter, IEntityViewModelSetter where TViewModel : class, IEntityViewModel
    {
        private MapContext _context;
        public MapContext Context => _context;
        MapContext IMapContextSetter.Context { set => _context = value; }
        private IEntityViewModel _viewModel;
        protected TViewModel VM => _viewModel as TViewModel;
        IEntityViewModel IEntityViewModelSetter.ViewModel { set => _viewModel = value; }

        public abstract void OnEnable(object intent);
        public abstract void OnDisable();
    }
}