Finish preliminary parser for TeknoMW3

This commit is contained in:
RaidMax
2019-02-02 18:54:30 -06:00
parent 59e0072744
commit 3e5282df87
12 changed files with 56 additions and 31 deletions

View File

@ -38,6 +38,22 @@ namespace SharedLibraryCore.Interfaces
public string Pattern { get; set; }
public Dictionary<GroupType, int> GroupMapping { get; private set; }
public void AddMapping(object mapKey, object mapValue)
{
if (int.TryParse(mapKey.ToString(), out int key) && int.TryParse(mapValue.ToString(), out int value))
{
if (GroupMapping.ContainsKey((GroupType)key))
{
GroupMapping[(GroupType)key] = value;
}
else
{
GroupMapping.Add((GroupType)key, value);
}
}
}
public ParserRegex()
{
GroupMapping = new Dictionary<GroupType, int>();