예제 #1
0
 protected virtual void OnGameEnded(GameEndedEventArgs e)
 {
     EventHandler<GameEndedEventArgs> eh = this.GameEnded;
     if (eh != null)
         eh(this, e);
 }
예제 #2
0
        private void WW_GameEnded(object sender, GameEndedEventArgs e)
        {
            GamesPlayed++;
            this.lblBrojIgara.Text = GamesPlayed.ToString();
            if (e.GameWon)
            {

                GamesWon++;
                this.lblBrojPobjeda.Text = GamesWon.ToString();
                this.Message.Text = "You won the game!";
            }
            else
            {
                Uspjesnost -= 1000;
                this.Message.Text = "Oh, no! You died.";
                this.lblBrojPoraza.Text = (GamesPlayed - GamesWon).ToString();
            }
            UkupnaUspjesnost += Uspjesnost - 1;
            lblProsjecnaUspjesnost.Text = (UkupnaUspjesnost / GamesPlayed).ToString();
            this.btnKorak.Enabled = false;
            this.btnOdigraj.Enabled = false;
            this.btnCreate.Enabled = true;
        }