Class ParserUtils
Parser utils for parsing vectors from strings
Inheritance
Namespace: i5.Toolkit.Core.Utilities
Assembly: cs.temp.dll.dll
Syntax
public static class ParserUtils
Methods
TryParseSpaceSeparatedVector2(string, out Vector2)
Tries to convert a space separated string to a Vector2
Declaration
public static bool TryParseSpaceSeparatedVector2(string input, out Vector2 result)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string which should be converted |
Vector2 | result | The result of the conversion; if the conversion failed, it has the default value |
Returns
Type | Description |
---|---|
bool | Returns true if the conversion was successful |
TryParseSpaceSeparatedVector3(string, out Vector3)
Tries to parse a string with three space-separated coordinates, e.g. "1.2 -5.3 1.0"
Declaration
public static bool TryParseSpaceSeparatedVector3(string input, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
string | input | The string which should be converted to a Vector3 |
Vector3 | result | The result of the conversion; if the conversion failed, it has the default value |
Returns
Type | Description |
---|---|
bool | Returns true if the string could be parsed, otherwise false |
TryParseStringArrayToVector2(string[], out Vector2)
Parses an array of strings to Vector2 The array must have exactly two entries so that the conversion succeeds
Declaration
public static bool TryParseStringArrayToVector2(string[] strValues, out Vector2 result)
Parameters
Type | Name | Description |
---|---|---|
string[] | strValues | The string array which should be parsed to a Vector2 |
Vector2 | result | The result of the conversion; if the conversion failed, it has the default value |
Returns
Type | Description |
---|---|
bool | Returns true if parsing was successful |
TryParseStringArrayToVector3(string[], out Vector3)
Tries to parse a string array to a Vector3 The array must have exactly three entries so that the conversion succeeds
Declaration
public static bool TryParseStringArrayToVector3(string[] strValues, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
string[] | strValues | The string array to parse |
Vector3 | result | The result of the conversion; if the conversion failed, it has the default value |
Returns
Type | Description |
---|---|
bool | Returns true if the string array could be parsed, otherwise false |
TryParseStringArrayToVector4(string[], out Vector4)
Tries to parse a string array to a Vector3 The array must have exactly four entries so that the conversion succeeds
Declaration
public static bool TryParseStringArrayToVector4(string[] strValues, out Vector4 result)
Parameters
Type | Name | Description |
---|---|---|
string[] | strValues | The string array to parse |
Vector4 | result | The result of the conversion; if the conversion failed, it has the default value |
Returns
Type | Description |
---|---|
bool | Returns true if the string array could be parsed, otherwise false |