BF2Statistics.Web.Bf2Stats.RankCalculator.GenerateMissingDesc C# (CSharp) Метод

GenerateMissingDesc() приватный статический Метод

Generates the Missing Awards description message, based on what awards are missing
private static GenerateMissingDesc ( Rank Rnk, bool ForPrevRank ) : string
Rnk Rank
ForPrevRank bool
Результат string
        private static string GenerateMissingDesc(Rank Rnk, bool ForPrevRank)
        {
            StringBuilder Msg = new StringBuilder();

            // Prefix
            if (ForPrevRank)
            {
                Msg.AppendFormat(
                    "You are not yet eligible for the advanced rank of <strong>{0}</strong> because you are missing the awards: ",
                    MedalData.Rank.GetName(Rnk.Id)
                );
            }
            else
                Msg.Append("You are missing the awards: ");

            // Add missing award titles
            int i = 0;
            foreach (KeyValuePair<string, int> Awd in Rnk.MissingAwards)
            {
                // Increment missing award ID
                i++;

                // Check for Badge, and append the badge level if so...
                string AwdId = (Awd.Key[0] == '1') ? Awd.Key + "_" + Awd.Value : Awd.Key;

                // Fetch the award's full string name
                string name = StatsConstants.Awards.ContainsKey(Awd.Key) ? MedalData.Award.GetName(AwdId) : "Unknown";

                // Add the award
                Msg.Append(name + ((i == Rnk.MissingAwards.Count) ? "." : ",") + " ");
            }

            return Msg.ToString();
        }