Skip to content

Commit

Permalink
fix: Updated ParseOptions to use original Default options
Browse files Browse the repository at this point in the history
Updated ParseOptions to use original Default options and also set the default parse to DefaultParsing
  • Loading branch information
Zemill committed Jan 21, 2020
1 parent ad81f18 commit 78b77c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Heroes.ReplayParser.ConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 18 additions & 5 deletions Heroes.ReplayParser/ParseOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -34,23 +34,36 @@ public class ParseOptions
AllowPTR = true,
ShouldParseDetailedBattleLobby = true,
ShouldParseMouseEvents = true,
ShouldParseUnits = true,
ShouldParseMessageEvents = true,
};

/// <summary>
/// Parse as excluding Units, Mouse Events, and Enabling the DetailedBattleLobby
/// </summary>
public static ParseOptions MediumParsing => new ParseOptions()
{
ShouldParseUnits = false,
ShouldParseMouseEvents = false,
ShouldParseDetailedBattleLobby = true,
};

/// <summary>
/// Parse as little as possible
/// </summary>
public static ParseOptions MinimalParsing => new ParseOptions()
{
ShouldParseEvents = false,
ShouldParseUnits = false,
ShouldParseMouseEvents = false,
ShouldParseDetailedBattleLobby = false
};



/// <summary>
/// Parsing for typical needs, excludes events, units and mouseevents.
/// </summary>
public static ParseOptions TypicalParsing => new ParseOptions();
public static ParseOptions DefaultParsing => new ParseOptions();

}
}

0 comments on commit 78b77c1

Please sign in to comment.