protected virtual void OnGameEnded(GameEndedEventArgs e) { EventHandler<GameEndedEventArgs> eh = this.GameEnded; if (eh != null) eh(this, e); }
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; }