Exemplo n.º 1
0
        internal void OnGameStateChanged(GameStateChangedEventArgs e)
        {
            switch (e.GameState)
            {
            case GameStates.LOST:
            {
                timer1.Enabled = false;
                Console.WriteLine("Game Over");
                btnNewGame.Image = Properties.Resources.NotSmiley;
                foreach (var tile in Game.Tiles)
                {
                    tile.ShowValue();
                }
                MessageBox.Show("You lost!");
                break;
            }

            case GameStates.WON:
            {
                timer1.Enabled   = false;
                btnNewGame.Image = Properties.Resources.VerySmiley;
                Console.WriteLine("Won the game");
                MessageBox.Show("You won!");
                //Add time to highscore
                break;
            }

            case GameStates.PLAYING:
            {
                btnNewGame.Image = Properties.Resources.Smiley;
                break;
            }
            }
        }
Exemplo n.º 2
0
 public void OnGameStateChanged(GameStateChangedEventArgs e)
 {
     GameStateChanged?.Invoke(e);
 }