Exemplo n.º 1
0
    private void CheckGroupNFCRace()
    {
        foreach (var player in playerList)
        {
            if (player.IsNFCRaceCompleted && !raceWinnersList.Contains(player.PlayerUserName))
            {
                raceWinnersList.Add(player.PlayerUserName);
                groupDisplayTasks[playerList.IndexOf(player)].text = InstructionController.GetPositionWord(raceWinnersList.IndexOf(player.PlayerUserName));
            }
        }

        if (raceWinnersList.Count == playerCount)
        {
            foreach (var player in playerList)
            {
                for (int i = 0; i < raceWinnersList.Count; i++)
                {
                    if (player.PlayerUserName == raceWinnersList[i])
                    {
                        int scoreAdjustment = (5 * (playerCount - i));
                        player.PlayerScore += scoreAdjustment;
                    }
                }
            }
            GroupActivityCompleted();
        }
    }