Beispiel #1
0
        protected override void OnStart()
        {
            base.OnStart();

            _score = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;

            _questions = _bootstrap.GetModel(ModelTypes.Questions) as QuestionsData;
            _questions.OnNewQuestionReady += QuestionDone;
            _questions.OnQuestionsOver    += NoMoreQuestions;

            _timeController = _bootstrap.GetController(ControllerTypes.Time) as TimeController;
            if (_timeController != null)
            {
                _timeController.GameTimeout += TimeOut;
            }

            if (SaveToRegistry)
            {
                _registry = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;
            }

            _sfx = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController;

            _answers = new Dictionary <int, int>();
        }
Beispiel #2
0
        protected override void OnStart()
        {
            base.OnStart();

            _quizController = _bootstrap.GetController(ControllerTypes.Quiz) as QuizController;

            _registry                    = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;
            _timeController              = _bootstrap.GetController(ControllerTypes.Time) as TimeController;
            _timeController.GameTimeout += Timeout;
            //_timeController.OnUpdateAppTime += StartTeleport;

            _scoreController    = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;
            _registerController = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;

            _character = _bootstrap.GetModel(ModelTypes.VRCharacter) as VRCharacter;
        }
Beispiel #3
0
        protected override void OnStart()
        {
            base.OnStart();

            _pagesController = _bootstrap.GetController(ControllerTypes.Page) as PagesController;
            _questionData    = _bootstrap.GetModel(ModelTypes.DynamicQuestions) as DynamicQuestionData;

            _registration = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;

            _sfx = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController;

            _timeController = _bootstrap.GetController(ControllerTypes.Time) as TimeController;

            if (_timeController != null)
            {
                _timeController.GameTimeout += GameTimeout;
            }
        }
Beispiel #4
0
        protected override void OnStart()
        {
            base.OnStart();

            _scoreController = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;
            _register        = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;

            _resourcesData = _bootstrap.GetModel(ModelTypes.Resources) as ResourcesDataBase;

            _timeController = _bootstrap.GetController(ControllerTypes.Time) as TimeController;
            if (_timeController != null)
            {
                _timeController.GameTimeout += TimeOut;
            }

            _SoundController = _bootstrap.GetController(ControllerTypes.SoundSFX) as SoundController;
            _questionsData   = _bootstrap.GetModel(ModelTypes.Questions) as QuestionsData;
            _AssociationData = _bootstrap.GetModel(ModelTypes.Association) as AssociationData;
        }
        protected override void OnStart()
        {
            base.OnStart();

            _pagesController    = _bootstrap.GetController(ControllerTypes.Page) as PagesController;
            _scoreController    = _bootstrap.GetController(ControllerTypes.Score) as ScoreController;
            _timeController     = _bootstrap.GetController(ControllerTypes.Time) as TimeController;
            _sfxController      = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController;
            _registerController = _bootstrap.GetController(ControllerTypes.Register) as RegisterController;

            _resources    = _bootstrap.GetModel(ModelTypes.Resources) as ResourcesDataBase;
            _images       = _bootstrap.GetModel(ModelTypes.Images) as ImagesDataBase;
            _gridDatabase = _bootstrap.GetModel(ModelTypes.Grid) as GridDatabase;

            _bootstrap.AppStarted += () =>
            {
                _grids = new List <GridCanvas2D>();
                List <Models.GridLayout> gList = _gridDatabase.GetGridsByGame(Type);

                for (int i = 0; i < gList.Count; i++)
                {
                    _grids.Add(new GridCanvas2D(gList[i]));
                }
            };

            _cardsPool = new List <List <Sprite> >();
            _cards     = new List <MemoryCard>();

            OnGamePrepare += GamePrepare;
            OnGameEnd     += GameEnded;

            if (hasTimer)
            {
                _timeController.GameTimeout += TimeOut;
            }

            _cardsPool = _images.GetImagesByCategory(ImageCategory.MemoryCard, true);
            _cardBack  = _images.GetImageByCategory(ImageCategory.MemoryBack);
        }