private void FinishMatch(PlayerType playerType) { if (selfPoints > saveController.BestScore) { saveController.BestScore.Value = selfPoints; BestPointsChanged?.Invoke(selfPoints); } MatchFinished?.Invoke(playerType); }
/// <summary> /// Stops this match. /// </summary> public void StopMatch() { _preparationTimer.Stop(); _subRoundTimer.Stop(); IsSubRoundRunning = false; IsRunning = false; IsFinished = true; MatchFinished?.Invoke(this, EventArgs.Empty); }
private void Match_SubRoundFinished(object sender, EventArgs e) { WordToDraw = null; RemainingTime = RoundLength; ResetHasGuessed(); var player = GetCurrentlyDrawingPlayer(); if (player != null) { player.Status = PlayerStatus.Guessing; PlayedPlayers.Add(player); } if (PlayedPlayers.Count >= Players.Count) { //Runde Beendet PlayedPlayers.Clear(); RoundFinished?.Invoke(this, EventArgs.Empty); if (CurrentRound == Rounds) { IsRunning = false; IsFinished = true; MatchFinished?.Invoke(this, EventArgs.Empty); return; } CurrentRound++; RoundStarted?.Invoke(this, new RoundStartedEventArgs(CurrentRound)); } player = GetPlayerWhoHasNotPlayed(); StartPreparationTimer(player); }
private void OnMatchFinished() => MatchFinished?.Invoke(this, EventArgs.Empty);