public BMIPresenter(BMIView view)
 {
     personNameInput   = new ReactiveProperty <string>();
     personAgeInput    = new ReactiveProperty <string>();
     personHeightInput = new ReactiveProperty <string>();
     personWeightInput = new ReactiveProperty <string>();
     this.view         = view;
 }
Example #2
0
        void FindGameObjects()
        {
            // find
            var canvas = GameObject.Find("Canvas").transform;

            bmiView     = canvas.Find("BMIView").GetComponent <BMIView>();
            historyView = canvas.Find("HistoryView").GetComponent <HistoryView>();
            accountView = canvas.Find("AccountView").GetComponent <AccountView>();
            // prefab
            var prefab     = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/BMIApp/Prefabs/HistoryElm.prefab");
            var historyElm = prefab.GetComponent <HistoryElmView>();

            // data
            sharedData  = ScriptableObject.CreateInstance <SharedScriptableObject>();
            historyData = new TemporaryHistoryDataStore();
            // set
            bmiPresenter.InnerPresenter       = new BMIPresenter(bmiView);
            historyPresenter.InnerPresenter   = new HistoryListPresenter(historyView, historyElm);
            accountPresenter.InnerPresenter   = new AccountPresenter(accountView);
            accountRepository.InnerRepository = new UserAccountRepository(sharedData);
            historyRepository.InnerRepository = new BMIHistoryRepository(historyData);
        }