Class UnrealHelpers
A helper class for parsing the Unreal Engine console command output.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Unreal
Assembly: GameStateTracker.Unreal.dll
Syntax
public static class UnrealHelpers
Methods
View SourceExtractText(string)
Gets the friendly name from an INVTEXT or NSLOCTEXT text macro.
Declaration
public static string ExtractText(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The input string. |
Returns
Type | Description |
---|---|
string | The internal string value. |
ParseGameplayAttributeData(string, IFormatProvider?)
Parses the gameplay attribute given the string representation.
Declaration
public static (float BaseValue, float CurrentValue)? ParseGameplayAttributeData(string input, IFormatProvider? formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string representation for the gameplay attribute. |
IFormatProvider | formatProvider | An object that supplies culture-specific formatting information. If null, the invariant culture is used. |
Returns
Type | Description |
---|---|
(float BaseValue, float CurrentValue)? | The base value and the current value. Null if unable to parse. |
ParseListClassesResult(string)
Parses the class details returned from the game.
Declaration
public static IEnumerable<KeyValuePair<string, string?>> ParseListClassesResult(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string returned by the command. |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> | An enumeration of subclass to parent class relationships. |
ParseListIntrinsicClassesResult(string)
Parses the class details returned from the game.
Declaration
public static IEnumerable<KeyValuePair<string, string?>> ParseListIntrinsicClassesResult(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string returned by the command. |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> | An enumeration of subclass to parent class relationships. |
ParseListObjectsResult(string, bool)
Parses the object details returned from the game.
Declaration
public static IEnumerable<ObjectInfo> ParseListObjectsResult(string input, bool skipClassTable = true)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string returned by the command. |
bool | skipClassTable | If true, detect and skip past the table of object count by class name. |
Returns
Type | Description |
---|---|
IEnumerable<ObjectInfo> | An enumeration of object information. |
ParseListPropertiesResult(string)
Parses the property names returned from the game.
Declaration
public static IEnumerable<string> ParseListPropertiesResult(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string returned by the command. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An enumeration of property names. |
ParsePropertyValueResult(string, string)
Parses the property values returned from the game for the given property name.
Declaration
public static IEnumerable<QueryResult> ParsePropertyValueResult(string propertyName, string input)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | The property name which was queried. |
string | input | The string returned by the command. |
Returns
Type | Description |
---|---|
IEnumerable<QueryResult> | An enumeration of query results. |
ParseTreeObjectLocation(Node, IFormatProvider?)
Parses the property values of a tree node representing a Vector3.
Declaration
public static Vector3 ParseTreeObjectLocation(Node node, IFormatProvider? formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
Node | node | The tree node. |
IFormatProvider | formatProvider | An object that supplies culture-specific formatting information. If null, the invariant culture is used. |
Returns
Type | Description |
---|---|
Vector3 | A Vector3, if it could be parsed. |
ReadArray(string, int?)
Reads a numbered list from the input string.
Declaration
public static IEnumerable<string> ReadArray(string value, int? maxSize = null)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string to parse. |
int? | maxSize | The maximum number of items. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An enumeration of items. |
ReadDictionary(IEnumerator<string>)
Reads a numbered list of key-value pairs from the input lines.
Declaration
public static IEnumerable<KeyValuePair<string, string>> ReadDictionary(IEnumerator<string> lines)
Parameters
Type | Name | Description |
---|---|---|
IEnumerator<string> | lines | The lines to parse. |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> | An enumeration of key-value pairs. |
SplitLines(string)
Splits the input string on newline characters, skipping empty lines, and trimming the result strings.
Declaration
public static IEnumerable<string> SplitLines(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | The input string. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An enumeration of lines. |
TrimObjCommandOutput(string, int)
Cleans the output of the console commands to list objects and property names.
Declaration
public static IEnumerable<string> TrimObjCommandOutput(string input, int headerLines = 3)
Parameters
Type | Name | Description |
---|---|---|
string | input | The input string. |
int | headerLines | The number of lines to skip. |
Returns
Type | Description |
---|---|
IEnumerable<string> | The list of objects or property names. |