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

MedalDataParser() static private method

Loads the default medal data into the Award Cache
static private MedalDataParser ( ) : System
return System
        static MedalDataParser()
        {
            // Fill the award cache with the original award conditions
            MatchCollection MedalsMatches, RankMatches;
            ParseMedalData(Program.GetResourceAsString("BF2Statistics.MedalData.PyFiles.medal_data_xpack.py"), out MedalsMatches, out RankMatches);

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

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