TextStudioTagParameters
public readonly struct TextStudioTagParametersAllocation-free read view over positional and named parameters parsed from one tag. Lookup is case-insensitive and later named values take precedence.
Fields
Section titled “Fields”
public static readonly TextStudioTagParameters EmptyReturns
TextStudio.TextStudioTagParameters
Constructors
Section titled “Constructors”
TextStudioTagParameters(string, string[], TextStudioNamedTagParameter[])
Section titled “TextStudioTagParameters(string, string[], TextStudioNamedTagParameter[])”public TextStudioTagParameters(string raw, string[] positional, TextStudioNamedTagParameter[] named)Creates a read-only parameter view over caller-supplied arrays that must not be mutated afterward.
Parameters
| Name | Type |
|---|---|
raw |
System.String |
positional |
System.String[] |
named |
TextStudio.TextStudioNamedTagParameter[] |
Methods
Section titled “Methods”
GetString(int, string)
Section titled “GetString(int, string)”public string GetString(int index, string defaultValue = "")Gets a positional string or a fallback when the index is absent.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
defaultValue |
System.String |
Returns
System.String
GetString(string, string)
Section titled “GetString(string, string)”public string GetString(string name, string defaultValue = "")Gets the last named string assignment or a fallback when it is absent.
Parameters
| Name | Type |
|---|---|
name |
System.String |
defaultValue |
System.String |
Returns
System.String
TryGetString(string, out string)
Section titled “TryGetString(string, out string)”public bool TryGetString(string name, out string value)Tries to read the last named direct string assignment.
Parameters
| Name | Type |
|---|---|
name |
System.String |
value |
System.String |
Returns
System.Boolean
TryGetNamedParameter(string, out TextStudioNamedTagParameter)
Section titled “TryGetNamedParameter(string, out TextStudioNamedTagParameter)”public bool TryGetNamedParameter(string name, out TextStudioNamedTagParameter parameter)Tries to read the last parsed parameter with a case-insensitive name.
Parameters
| Name | Type |
|---|---|
name |
System.String |
parameter |
TextStudio.TextStudioNamedTagParameter |
Returns
System.Boolean
HasFlag(string)
Section titled “HasFlag(string)”public bool HasFlag(string name)Reports whether the last parameter with the requested name is a flag.
Parameters
| Name | Type |
|---|---|
name |
System.String |
Returns
System.Boolean
TryGetFloat(int, out float)
Section titled “TryGetFloat(int, out float)”public bool TryGetFloat(int index, out float value)Parses a positional value as an invariant finite or non-finite floating-point value.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
value |
System.Single |
Returns
System.Boolean
TryGetFloat(string, out float)
Section titled “TryGetFloat(string, out float)”public bool TryGetFloat(string name, out float value)Parses a named direct assignment as an invariant floating-point value.
Parameters
| Name | Type |
|---|---|
name |
System.String |
value |
System.Single |
Returns
System.Boolean
TryResolveFloat(float, string, out float, params string[])
Section titled “TryResolveFloat(float, string, out float, params string[])”public bool TryResolveFloat(float baseline, string name, out float value, params string[] aliases)Resolves the last named assignment or multiplier against a baseline value.
Parameters
| Name | Type |
|---|---|
baseline |
System.Single |
name |
System.String |
value |
System.Single |
aliases |
System.String[] |
Returns
System.Boolean: false for missing, malformed, NaN, or infinite results.
TryGetInt(string, out int)
Section titled “TryGetInt(string, out int)”public bool TryGetInt(string name, out int value)Parses a named direct assignment as an invariant integer.
Parameters
| Name | Type |
|---|---|
name |
System.String |
value |
System.Int32 |
Returns
System.Boolean
TryGetColor(int, out Color32)
Section titled “TryGetColor(int, out Color32)”public bool TryGetColor(int index, out Color32 value)Parses a positional color using Text Studio color syntax.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
value |
UnityEngine.Color32 |
Returns
System.Boolean
TryGetColor(string, out Color32)
Section titled “TryGetColor(string, out Color32)”public bool TryGetColor(string name, out Color32 value)Parses a named color, including multi-token color syntax.
Parameters
| Name | Type |
|---|---|
name |
System.String |
value |
UnityEngine.Color32 |
Returns
System.Boolean
TryGetBool(string, out bool)
Section titled “TryGetBool(string, out bool)”public bool TryGetBool(string name, out bool value)Parses a flag or named boolean using true/false, 1/0, yes/no, and on/off syntax.
Parameters
| Name | Type |
|---|---|
name |
System.String |
value |
System.Boolean |
Returns
System.Boolean
Properties
Section titled “Properties”
public string Raw { get; }Returns
System.String
Positional
Section titled “Positional”public IReadOnlyList<string> Positional { get; }Returns
System.Collections.Generic.IReadOnlyList{System.String}
public IReadOnlyList<TextStudioNamedTagParameter> Named { get; }Returns
System.Collections.Generic.IReadOnlyList{TextStudio.TextStudioNamedTagParameter}
PositionalCount
Section titled “PositionalCount”public int PositionalCount { get; }Returns
System.Int32
NamedCount
Section titled “NamedCount”public int NamedCount { get; }Returns
System.Int32