private void UpdatePointSystem(Player p, int points) { var playerPoints = new Dictionary <Player, int>(); playerPoints.Add(p, points); MinigamePointSystem.UpdateScore(playerPoints); }
public void EndMinigame() { EndMinigameMechanics(); StopAllCoroutines(); ToggleActive(false); SoundEventInfo sei = new SoundEventInfo(applauseSound, applauseSoundVolume, 2); EventHandler.Instance.FireEvent(EventHandler.EventType.SoundEvent, sei); if (gameType == GameType.PointsBased || gameType == GameType.PointsAndLives) { StartCoroutine("DisplayPlayerScores"); } else if (gameType == GameType.Finale) { var playerPoints = new Dictionary <Player, int>(); foreach (var item in MinigamePointSystem.GetCurrentScore()) { playerPoints.Add(item.Key, (int)(item.Value * ImportManager.Instance.Settings.FinaleScoreMultiplier)); } MinigamePointSystem.UpdateScore(playerPoints); ShowStandingsUI(); StartCoroutine("GoToNextScene", endOfMatchDelay); } else { ShowStandingsUI(); StartCoroutine("GoToNextScene", endOfMatchDelay); } }
private void InitPlayers() { foreach (var item in GameController.Instance.Players) { playersAlive.Add(item, true); } MinigamePointSystem.InitializePlayers(GameController.Instance.Players); }
private void ConvertMinigamePointsToFinalePoints() { var sorted = from playerScore in MinigamePointSystem.GetCurrentScore() orderby playerScore.Value select playerScore; int placementOrder = 1; KeyValuePair <Player, int> previousScore = new KeyValuePair <Player, int>(new Player(), int.MinValue); foreach (var item in sorted.ToList()) { if (item.Value == previousScore.Value) { MinigamePointSystem.GetCurrentScore()[item.Key] = MinigamePointSystem.GetCurrentScore()[previousScore.Key]; } else { MinigamePointSystem.GetCurrentScore()[item.Key] = placementOrder; } placementOrder++; previousScore = item; } }