Skip to content

Class FieldText

Namespace: Apogee.Reflection
Assembly: Apogee.Reflection.dll

A component field as text and back: what a scene file holds in an attribute, and what prefab overrides and the clipboard will hold. The text is the same in every culture (): booleans are true and false, integers decimal, floats the shortest text that reads back as the same number (with NaN, Infinity and -Infinity), and a , or is its numbers separated by single spaces (1 2 3, 0 0 0 1).

and are not here: what they hold only means something in a world (an entity's id, an asset handle), so whoever has that context writes and reads them.

public static class FieldText

Inheritance

object ← FieldText

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

Format(FieldDef, byte*)

The text of the field whose value is at at (the field's own address, not the component's start).

public static string Format(FieldDef field, byte* at)

Parameters

field FieldDef

at byte*

Returns

string

Exceptions

ArgumentException

The kind is or .

Handles(FieldKind)

Whether and handle the kind (every kind except and ).

public static bool Handles(FieldKind kind)

Parameters

kind FieldKind

Returns

bool

Parse(FieldDef, string, byte*)

Reads text into the field whose value is at at (the field's own address).

public static void Parse(FieldDef field, string text, byte* at)

Parameters

field FieldDef

text string

at byte*

Exceptions

FormatException

The text is not a value of the kind, or is out of its range.

ArgumentException

The kind is or .