Skip to content

Archmage.Tuple

A fixed number of values, the type of a tuple field.

Inherits: RefCounted

A tuple has 1 to 7 values. In the config files, it is an object with the keys item0 to item6.

var items: Array = []

The values, of the types of the tuple fields. A value that references a config entry holds the entry.

var item0: Variant

items[0].

var item1: Variant

items[1].

var item2: Variant

items[2].

var item3: Variant

items[3].

var item4: Variant

items[4].

var item5: Variant

items[5].

var item6: Variant

items[6].

static func from_json(d: Variant, convs: Array[Callable], e: Archmage.ParseError = null, refs: Array[int] = []) -> Archmage.Tuple

Returns the tuple in d, a parsed JSON object, converting the value at index i with convs[i].call(value, e), or null when d is null. For any other value that is not an object, returns null too and records the type mismatch in e (see Archmage.ParseError.report_mismatch()). When a conversion records an error in e, returns null. The values at the indexes in refs are config IDs: they go to _ref_ids, and items holds null at those indexes until the generated code resolves them.

func to_json() -> Dictionary

Returns the tuple as a JSON object. A value that references a config entry is written as its config ID.

func size() -> int

Returns the number of values.