Ejemplo n.º 1
0
    private void RefreshScores()
    {
        var scores = simulation.GetScores();


        StringBuilder sb = new StringBuilder();

        sb.Append("LEADERBOARD");

        sb.AppendLine();
        sb.AppendLine();

        if (!ConfigValueStore.GetBoolValue("team_mode"))
        {
            foreach (TankController t in scores)
            {
                sb.Append(t.Name + " - " + t.Points);
                sb.AppendLine();
            }
        }
        else
        {
            foreach (string team in simulation.teams.Keys)
            {
                int teamTotal = 0;
                foreach (TankController t in scores)
                {
                    if (GameSimulation.GetTeamName(t.Name) == team)
                    {
                        teamTotal += t.Points;
                    }
                }
                sb.Append(team + " - " + teamTotal);
                sb.AppendLine();
            }
        }

        scoreBoard.text = sb.ToString();

        scoreRefreshTime = DateTime.Now;
    }