AddRank() public static method

Used by the parser to add found ranks to the list
public static AddRank ( Rank A ) : void
A Rank The Rank Object To Add
return void
Example #1
0
        /// <summary>
        /// This method builds the award cache with the given data from the medal data file.
        /// This method WILL CLEAR the award cache from any existing medals
        /// </summary>
        /// <param name="MedalsMatches"></param>
        /// <param name="RanksMatches"></param>
        public static void BuildAwardCache(MatchCollection MedalsMatches, MatchCollection RanksMatches)
        {
            // Clear out the award cache!
            AwardCache.Clear();

            // Convert each medal match into an object, and add it to the award cache
            foreach (Match ArrayMatch in MedalsMatches)
            {
                AwardCache.AddAward(
                    new Award(
                        ArrayMatch.Groups["MedalIntId"].Value,
                        ArrayMatch.Groups["MedalStrId"].Value,
                        ArrayMatch.Groups["RewardType"].Value,
                        ParseCondition(ArrayMatch.Groups["Conditions"].Value)
                        )
                    );
            }

            // Convert ranks into objects, and also add them to the award cache
            foreach (Match ArrayMatch in RanksMatches)
            {
                AwardCache.AddRank(
                    new Rank(
                        Int32.Parse(ArrayMatch.Groups["RankId"].Value),
                        ParseCondition(ArrayMatch.Groups["Conditions"].Value)
                        )
                    );
            }
        }