Пример #1
0
        public PlayerAndScore[] SortedByScore()
        {
            Player[]         all    = allPlayers.Items;
            PlayerAndScore[] sorted = new PlayerAndScore[all.Length];

            for (int i = 0; i < all.Length; i++)
            {
                PlayerAndScore entry = new PlayerAndScore();
                entry.p     = all[i];
                entry.Score = Get(entry.p).Score;
                sorted[i]   = entry;
            }

            Array.Sort(sorted, (a, b) => b.Score.CompareTo(a.Score));
            return(sorted);
        }
Пример #2
0
        public string FormatTopScore(PlayerAndScore[] top, int i)
        {
            string         col = "&f";
            PlayerAndScore p   = top[i];

            if (i == 0)
            {
                col = "&6";
            }
            if (i == 1)
            {
                col = "&7";
            }
            if (i == 2)
            {
                col = "&4";
            }

            return(String.Format("{0}) {2} - {1}{3} points", i + 1, col,
                                 p.p.ColoredName, p.Score));
        }