From 78b77c16910e0fcedbdba3ce284ef57bf4ddd6ef Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 21 Jan 2020 12:26:05 -0500 Subject: [PATCH] fix: Updated ParseOptions to use original Default options Updated ParseOptions to use original Default options and also set the default parse to DefaultParsing --- .../Program.cs | 2 +- Heroes.ReplayParser/ParseOptions.cs | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Heroes.ReplayParser.ConsoleApplication/Program.cs b/Heroes.ReplayParser.ConsoleApplication/Program.cs index 2bc7192..d93e4f5 100644 --- a/Heroes.ReplayParser.ConsoleApplication/Program.cs +++ b/Heroes.ReplayParser.ConsoleApplication/Program.cs @@ -14,7 +14,7 @@ static void Main(string[] args) // Attempt to parse the replay // Ignore errors can be set to true if you want to attempt to parse currently unsupported replays, such as 'VS AI' or 'PTR Region' replays - var (replayParseResult, replay) = DataParser.ParseReplay(randomReplayFileName, deleteFile: false, ParseOptions.FullParsing); + var (replayParseResult, replay) = DataParser.ParseReplay(randomReplayFileName, deleteFile: false, ParseOptions.DefaultParsing); // If successful, the Replay object now has all currently available information if (replayParseResult == DataParser.ReplayParseResult.Success) diff --git a/Heroes.ReplayParser/ParseOptions.cs b/Heroes.ReplayParser/ParseOptions.cs index 191a733..8e4d8a0 100644 --- a/Heroes.ReplayParser/ParseOptions.cs +++ b/Heroes.ReplayParser/ParseOptions.cs @@ -20,9 +20,9 @@ public class ParseOptions public bool IgnoreErrors { get; set; } = false; public bool AllowPTR { get; set; } = false; public bool ShouldParseEvents { get; set; } = true; - public bool ShouldParseUnits { get; set; } = false; - public bool ShouldParseMouseEvents { get; set; } = false; - public bool ShouldParseDetailedBattleLobby { get; set; } = true; + public bool ShouldParseUnits { get; set; } = true; + public bool ShouldParseMouseEvents { get; set; } = true; + public bool ShouldParseDetailedBattleLobby { get; set; } = false; public bool ShouldParseMessageEvents { get; set; } = false; public bool ShouldParseStatistics { get; set; } = true; @@ -34,23 +34,36 @@ public class ParseOptions AllowPTR = true, ShouldParseDetailedBattleLobby = true, ShouldParseMouseEvents = true, - ShouldParseUnits = true, ShouldParseMessageEvents = true, }; + /// + /// Parse as excluding Units, Mouse Events, and Enabling the DetailedBattleLobby + /// + public static ParseOptions MediumParsing => new ParseOptions() + { + ShouldParseUnits = false, + ShouldParseMouseEvents = false, + ShouldParseDetailedBattleLobby = true, + }; + /// /// Parse as little as possible /// public static ParseOptions MinimalParsing => new ParseOptions() { ShouldParseEvents = false, + ShouldParseUnits = false, + ShouldParseMouseEvents = false, ShouldParseDetailedBattleLobby = false }; + + /// /// Parsing for typical needs, excludes events, units and mouseevents. /// - public static ParseOptions TypicalParsing => new ParseOptions(); + public static ParseOptions DefaultParsing => new ParseOptions(); } }