Scripting / Reference
Data
Types in the ParelVR.Volt.Data namespace.
VoltData#
ParelVR.Volt.Data.VoltData class
Structured data with named values, the shape of a JSON object. Use it for web requests, storage and anything that needs more than a flat list of fields.
VoltData constructors#
Creates an empty object.
VoltData properties#
Number of named values.
The value of a name. A token that holds nothing when the name is not present.
VoltData methods#
Removes every named value.
True when a name is present.
Bool value of a name, or a fallback.
Number value of a name as a float, or a fallback.
Number value of a name as an int, or a fallback.
Every name, in the order the values were added.
Text value of a name, or a fallback.
Removes a named value.
VoltDataList#
ParelVR.Volt.Data.VoltDataList class
A list of data tokens.
VoltDataList constructors#
Creates an empty list.
VoltDataList properties#
Number of tokens.
The token at an index.
VoltDataList methods#
Adds a token at the end.
Removes every token.
Removes the token at an index.
VoltDataToken#
ParelVR.Volt.Data.VoltDataToken class
One value of structured data: nothing, a bool, a number, text, a list or an object.
VoltDataToken properties#
The bool, or false when the token is not a bool.
The number as a float, or 0.
The number as an int, or 0.
True when the token holds nothing.
The list, or null when the token is not a list.
A token that holds nothing.
The number, or 0 when the token is not a number.
The object, or null when the token is not an object.
The text, or an empty string when the token is not text.
What the token holds.
Operators and conversions: 7 available.
VoltDataType#
ParelVR.Volt.Data.VoltDataType enum
What a data token holds.
Values: Null, Boolean, Number, String, List, Object
VoltDictionary#
ParelVR.Volt.Data.VoltDictionary<TKey, TValue> class
A table that finds a value by its key. Keys can be numbers, strings, bools, characters and enums.
VoltDictionary constructors#
Creates an empty dictionary.
VoltDictionary properties#
Number of entries.
The value of a key. Reading a key that is not present stops the script with an error; use TryGetValue when unsure.
VoltDictionary methods#
Adds an entry. The key must not be present yet.
Removes every entry.
True when a key is present.
A new array with every key, in the order the entries were added.
A new array with every value, in the order the entries were added.
Removes an entry. Returns false when the key was not present.
Reads a value if its key is present.
VoltJson#
ParelVR.Volt.Data.VoltJson static
Converts between structured data and JSON text. Input is limited to one megabyte and 32 levels of nesting.
VoltJson methods#
Writes a token as JSON text.
Writes a token as JSON text with line breaks and indentation.
Reads JSON text. Returns false when the text is not valid JSON or is too large.
VoltList#
ParelVR.Volt.Data.VoltList<T> class
A resizable list. Every list counts toward the world's script memory, and a list cannot grow beyond one million items.
VoltList constructors#
Creates an empty list.
VoltList properties#
Number of items.
The item at an index.
VoltList methods#
Adds an item at the end.
Adds every item of an array at the end.
Removes every item.
True when the list holds an item equal to a value.
Index of the first item equal to a value, or -1.
Puts an item at an index and moves the rest up.
Removes the first item equal to a value. Returns false when there is none.
Removes the item at an index.
Reverses the order of the items.
Sorts numbers and strings from smallest to largest. Other items keep their order.
A new array with the items of the list.
