/// <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)
)
);
}
}