protected virtual void OnPlayerScored(PlayerScoreEventArgs e) { try { if (e.IsThereAWinner) { var potentialPlayerWinning = CurrentScores.First(c => c.Player == e.Platformer2DUserControl.m_PlayerData); potentialPlayerWinning.CurrentScore++; e.PlayerScore = potentialPlayerWinning.CurrentScore; } } catch (Exception ex) { ex.Log("InScoreManager when checking for winner"); throw; } try { EventHandler<PlayerScoreEventArgs> handler = PlayerScored; if (handler != null) handler(this, e); } catch (Exception ex) { ex.Log(); throw; } }
protected virtual void OnPlayerScored(PlayerScoreEventArgs e) { try { if (e.IsThereAWinner) { var potentialPlayerWinning = CurrentScores.First(c => c.Player == e.Platformer2DUserControl.m_PlayerData); potentialPlayerWinning.CurrentScore++; e.PlayerScore = potentialPlayerWinning.CurrentScore; } } catch (Exception ex) { ex.Log("InScoreManager when checking for winner"); throw; } try { EventHandler <PlayerScoreEventArgs> handler = PlayerScored; if (handler != null) { handler(this, e); } } catch (Exception ex) { ex.Log(); throw; } }
private void CheckEndOfRound(object sender, PlayerScoreEventArgs e) { if (!_roundEnded) { _roundEnded = true; ClearRoundSFX(); if (e.IsThereAWinner) { if (CheckIfMatchWinner()) { RoundMenu.instance.DisplayRoundMenu(true, true, e.Platformer2DUserControl.m_PlayerData.PlayerSponsor.SponsorName, GameState.MatchEnd); m_CurrentState = GameState.PreMatchEnd; } else { RoundMenu.instance.DisplayRoundMenu(true, false, e.Platformer2DUserControl.m_PlayerData.PlayerSponsor.SponsorName, GameState.RoundEnd); m_CurrentState = GameState.PreRoundEnd; } } else { RoundMenu.instance.DisplayRoundMenu(true, false, Database.instance.GameTexts[15], GameState.RoundEnd); m_CurrentState = GameState.PreRoundEnd; } } }
private void scoreOnPlayerScoreUpdated(object sender, PlayerScoreEventArgs e) { this.scoreTextBlock.Text = e.Score.ToString(); }