コード例 #1
0
    private void UpdatePointSystem(Player p, int points)
    {
        var playerPoints = new Dictionary <Player, int>();

        playerPoints.Add(p, points);
        MinigamePointSystem.UpdateScore(playerPoints);
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
 private void InitPlayers()
 {
     foreach (var item in GameController.Instance.Players)
     {
         playersAlive.Add(item, true);
     }
     MinigamePointSystem.InitializePlayers(GameController.Instance.Players);
 }
コード例 #4
0
    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;
        }
    }