using System.Collections; using System.Collections.Generic; using UnityEngine; namespace EvolutStudio { namespace tinysAPI { namespace BaseClasses { abstract public class BaseClassExtension : BaseClass { #region Public Attributes // Gives access to the app and all instances. public Application appInstance { get { return Application.instance; } } // public access references of the MVP. public BaseClassModel Model { get { return _model; } } public BaseClassPresenter Presenter { get { return _presenter; } } public BaseClassView View { get { return _view; } } // Readable Access to Extension Description public string ExtensionName { get { return _extName; } } public string ExtensionVersionNumber { get { return _extVersionNumber; } } public string ExtensionCategory { get { return _extCategory; } } #endregion #region Private Attributes // private reference of the MVP. private BaseClassModel _model = null; private BaseClassPresenter _presenter = null; private BaseClassView _view = null; // private extension description fields protected string _extName = "BaseClassExtension"; protected string _extVersionNumber = "1.0.0"; protected string _extCategory = "Extension.Basic"; #endregion #region Public Functions // public function for setting the model reference public void RegisterModel(BaseClassModel model) { // check if _model is null, else log an error for trying to overwrite the current model if (_model == null) { _model = model; } else { Debug.LogError(string.Format("Trying to overwrite the current model: {0} with {1}", _model, model)); } } // public function for setting the presenter reference public void RegisterPresenter(BaseClassPresenter presenter) { // check if _presenter is null, else log an error for trying to overwrite the current presenter if (_presenter == null) { _presenter = presenter; } else { Debug.LogError(string.Format("Trying to overwrite the current presenter: {0} with {1}", _presenter, presenter)); } } // public function for setting the view reference public void RegisterView(BaseClassView view) { // check if _view is null, else log an error for trying to overwrite the current view if (_view == null) { _view = view; } else { Debug.LogError(string.Format("Trying to overwrite the current view: {0} with {1}", _view, view)); } } #endregion #region Private Functions #endregion #region Interface Functions #endregion } } } }