Ejemplo n.º 1
0
        private void GamesManagerEventHandler(object sender, GameManagerEventArgs e)
        {
            switch (e.Level)                                    // Which level raised the event
            {
            case DifficultyLevels.VeryEasy:                     // Very Easy level raised event
                GameCountVeryEasy = e.Count.ToString();         // Save the count to the Very Easy level property
                break;

            case DifficultyLevels.Easy:                         // Easy level raised the event
                GameCountEasy = e.Count.ToString();             // Save the count to the Easy level property
                break;

            case DifficultyLevels.Medium:                       // Medium level raised the event
                GameCountMedium = e.Count.ToString();           // Save the count to the Medium level property
                break;

            case DifficultyLevels.Hard:                         // Hard level raised the event
                GameCountHard = e.Count.ToString();             // Save the count to the Hard level property
                break;

            case DifficultyLevels.Expert:                       // Expert level raised the event
                GameCountExpert = e.Count.ToString();           // Save the count to the Expert level property
                break;
            }
        }
Ejemplo n.º 2
0
 protected virtual void OnPlayerDown(GameManagerEventArgs e)
 {
     if (PlayerDown != null)
     {
         PlayerDown.Invoke(this, e);
     }
 }
Ejemplo n.º 3
0
        private void RaiseEvent(GameManagerEventArgs e)
        {
            EventHandler <GameManagerEventArgs> handler = GamesManagerEvent;    // Get a pointer to the event handler

            if (handler != null)                                                // Any listeners?
            {
                handler(this, e);                                               // Yes, then raise the event
            }
        }
Ejemplo n.º 4
0
        protected virtual void RaiseEvent(Int32 count)
        {
            EventHandler <GameManagerEventArgs> handler = GameManagerEvent;

            if (handler != null)
            {
                GameManagerEventArgs e = new GameManagerEventArgs(_level, count);
                handler(this, e);
            }
        }
Ejemplo n.º 5
0
        protected override void DyingAnimation(GameTime i_GameTime)
        {
            GameManagerEventArgs gameManagerEventArgs;

            if (getAnimationTime(i_GameTime) <= k_TimeToAnimate)
            {
                this.Dispose();
                this.RotatingAnimation(this.CyclesPerSecond);
                this.FadeAnimation(i_GameTime, this.TimeToFade);
            }
            else
            {
                m_DidFinishDying                = true;
                gameManagerEventArgs            = new GameManagerEventArgs();
                gameManagerEventArgs.PlayerType = this.PlayerType;
                OnPlayerDown(gameManagerEventArgs);
                OnRemoveMeAsNotifier();
            }
        }
Ejemplo n.º 6
0
 private void updatesGameManager_PlayerDown(object sender, GameManagerEventArgs e)
 {
     handleDeadPlayer(sender as IUpdateGameManager, e.PlayerType);
 }
Ejemplo n.º 7
0
 private void GameManagerEventHandler(object sender, GameManagerEventArgs e)
 {
     RaiseEvent(e);
 }