Esempio n. 1
0
        public AppController()
        {
            try
            {
                Model = AppModel.Load(AppModel.CONFIG_NAME);
            }
            catch (Exception e)
            {
                MonoLog.Log(MonoLogChannel.AppController, e);
                Model = new AppModel();
            }

            Model.AddObserver(this);

            _stateMachine = new StateMachine(this);
            _stateFlow    = new StateFlow(this, _stateMachine);
            _stateFlow.Add(new StateFlow.NextStatePair(typeof(AppInitializeState), typeof(AppReadyState)));

            LoadConfigs();
        }
Esempio n. 2
0
        public static bool Load(AppModel model)
        {
            try
            {
//				Localization = LocalizationConfig.Load(model.Language);
//				Game = GameConfig.Default();//GameConfig.Load(GameConfig.FILE_NAME);
//				GameCenter = GameCenterConfig.Default();//GameCenterConfig.Load(GameCenterConfig.FILE_NAME);
//				Elements = ElementConfig.Default();
                Levels = LevelConfig.Default();
                Game   = GameConfig.Default();
            }
            catch (Exception e)
            {
                MonoLog.Log(MonoLogChannel.Exceptions, e);

                return(false);
            }

            return(true);
        }