Skip to content

TextStudioTagParameters

StructTextStudioTextStudio
public readonly struct TextStudioTagParameters

Allocation-free read view over positional and named parameters parsed from one tag. Lookup is case-insensitive and later named values take precedence.

public static readonly TextStudioTagParameters Empty

Returns

TextStudio.TextStudioTagParameters

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[]

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

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

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

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

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

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.

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

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

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

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

public string Raw { get; }

Returns

System.String

public IReadOnlyList<string> Positional { get; }

Returns

System.Collections.Generic.IReadOnlyList{System.String}

public IReadOnlyList<TextStudioNamedTagParameter> Named { get; }

Returns

System.Collections.Generic.IReadOnlyList{TextStudio.TextStudioNamedTagParameter}

public int PositionalCount { get; }

Returns

System.Int32

public int NamedCount { get; }

Returns

System.Int32