1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Add commenting for parsers

rename IW4*Parser to Base*Parser
This commit is contained in:
RaidMax
2019-02-02 19:40:37 -06:00
parent 5e7aefb35f
commit 0860ce6f62
16 changed files with 171 additions and 74 deletions

View File

@ -6,6 +6,10 @@ namespace SharedLibraryCore.Interfaces
{
public sealed class ParserRegex
{
/// <summary>
/// represents the logical mapping of information provided by
/// game logs, get status, and get dvar information
/// </summary>
public enum GroupType
{
EventType,
@ -35,9 +39,24 @@ namespace SharedLibraryCore.Interfaces
RConDvarDomain = 110,
AdditionalGroup = 200
}
/// <summary>
/// stores the regular expression groups that will be mapped to group types
/// </summary>
public string Pattern { get; set; }
/// <summary>
/// stores the mapping from group type to group index in the regular expression
/// </summary>
public Dictionary<GroupType, int> GroupMapping { get; private set; }
/// <summary>
/// helper method to enable script parsers to app regex mapping
/// the first parameter specifies the group type contained in the regex pattern
/// the second parameter specifies the group index to retrieve in the matched regex pattern
/// </summary>
/// <param name="mapKey">group type</param>
/// <param name="mapValue">group index</param>
public void AddMapping(object mapKey, object mapValue)
{
if (int.TryParse(mapKey.ToString(), out int key) && int.TryParse(mapValue.ToString(), out int value))