Пример #1
0
        private void Initialize(GtFactory pFactory, GtFileLoader pFileLoader, ISongPlayer pSongPlayer, IAudioEffects pAudioEffects)
        {
            this.Factory = pFactory;

            this.SongPlayer = pSongPlayer;

            this.fFileLoader = pFileLoader;

            this.AudioEffects = pAudioEffects;

            this.CurrentScreen = EnumGameScreen.Undefined;

            this.AudioListener = pFactory.Instantiate <IAudioListener>(SAMPLE_FREQUENCE);

            //must be after AudioListener instantiation
            this.GameRoundController = pFactory.Instantiate <IGtGameRoundController>(pFactory, this);

            this.TuneController = pFactory.Instantiate <IGtTuneController>();

            this.AudioListener.Start();
        }
Пример #2
0
        public GtGameController(GtFactory pFactory, GtFileLoader pFileLoader, ISongPlayer pSongPlayer, IAudioEffects pAudioEffects)
        {
            if (pSongPlayer == null)
            {
                throw new InvalidParameter("pSongPlayer can't be null");
            }

            if (pFactory == null)
            {
                throw new InvalidParameter("pFactory can't be null");
            }

            if (pAudioEffects == null)
            {
                throw new InvalidParameter("pAudioEffects can't be null");
            }

            Initialize(pFactory, pFileLoader, pSongPlayer, pAudioEffects);
        }