Esempio n. 1
0
        protected virtual void OnGameStateChanged(GameStateChangedEventArgs e)
        {
            EventHandler <GameStateChangedEventArgs> handler = RaiseGameStateChangedEvent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 2
0
        private void Game_RaiseGameStateChangedEvent(object sender, GameStateChangedEventArgs e)
        {
            if (e.NewState == GameState.Over)
            {
                return;
            }

            if (e.NewState == GameState.Ready && Player.Lives == 0)
            {
                State = GameState.Over;
            }
        }