BF2Statistics.MedalData.MedalDataParser.BuildAwardCache C# (CSharp) Method

BuildAwardCache() public static method

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
public static BuildAwardCache ( MatchCollection MedalsMatches, MatchCollection RanksMatches ) : void
MedalsMatches System.Text.RegularExpressions.MatchCollection
RanksMatches System.Text.RegularExpressions.MatchCollection
return void
        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)
                    )
                );
            }
        }