C# Class BF2Statistics.MedalData.MedalDataParser

Show file Open project: BF2Statistics/ControlCenter Class Usage Examples

Public Methods

Method Description
BuildAwardCache ( MatchCollection MedalsMatches, MatchCollection RanksMatches ) : void

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

LoadMedalDataFile ( string FilePath ) : void

This method loads a Medal data python file, and parses it. The medal data is stored in the AwardCache object

ParseMedalData ( string Data, MatchCollection &MedalsMatches, MatchCollection &RanksMatches ) : void

This method takes a medal data string, and parses it. The parsed match collections are passed back out from referenced variables

ParseNodeConditions ( TreeNode Node ) : Condition

Takes a node tree and converts it to a Condition

ReadPythonFile ( string file ) : string

Simple easy way to get the contents of a file, excluding empty lines.

Private Methods

Method Description
MedalDataParser ( ) : System

Loads the default medal data into the Award Cache

ParseCondition ( List parts, int &i ) : Condition

Parses a string condition into condition objects

ParseCondition ( string ConditionString ) : Condition

Parses a string condition into condition objects

ParseFunctions ( List &parts ) : bool

Takes each literal token, and determines if its a StatFunction, or ConditionFunction

Tokenize ( TokenType tokenKind, string pattern, int>.KeyValuePair &untokenizedParts ) : IEnumerable

Performs tokenization of a collection of non-tokenized data parts with a specific pattern

Tokenize ( string source ) : IEnumerable

Breaks an input string into recognizable tokens

Method Details

BuildAwardCache() public static method

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
public static BuildAwardCache ( MatchCollection MedalsMatches, MatchCollection RanksMatches ) : void
MedalsMatches System.Text.RegularExpressions.MatchCollection
RanksMatches System.Text.RegularExpressions.MatchCollection
return void

LoadMedalDataFile() public static method

This method loads a Medal data python file, and parses it. The medal data is stored in the AwardCache object
public static LoadMedalDataFile ( string FilePath ) : void
FilePath string The full file path to the python file
return void

ParseMedalData() public static method

This method takes a medal data string, and parses it. The parsed match collections are passed back out from referenced variables
public static ParseMedalData ( string Data, MatchCollection &MedalsMatches, MatchCollection &RanksMatches ) : void
Data string The contents of the medal data file
MedalsMatches System.Text.RegularExpressions.MatchCollection
RanksMatches System.Text.RegularExpressions.MatchCollection
return void

ParseNodeConditions() public static method

Takes a node tree and converts it to a Condition
public static ParseNodeConditions ( TreeNode Node ) : Condition
Node System.Windows.Forms.TreeNode
return Condition

ReadPythonFile() public static method

Simple easy way to get the contents of a file, excluding empty lines.
public static ReadPythonFile ( string file ) : string
file string
return string