LuaTuple
Description
The LuaTuple class is used to receive any number of arguments from Lua and to return any number of values to Lua.
This class behaves like a stack but you can also convert it to and from an array.
Methods
from_array LuaTuple
Static method that creates a LuaTuple with the contents of an array.
Parameters
Parameters | Description |
---|---|
content: array |
The content with which the tuple will be populated. |
Returns
LuaTuple
Example
clear void
Removes all elements from the LuaTuple's stack.
Parameters
None
Returns
void
get_value Variant
Gets a value from the LuaTuple's stack at the specified index. It does not pop the value from the stack.
Parameters
Parameters | Description |
---|---|
index: number |
The index of the value to get. |
Returns
Variant
is_empty bool
Returns true
if the LuaTuple's stack is empty and false otherwise.
Parameters
None
Returns
bool
pop_back Variant
Removes the last element from the LuaTuple's stack and returns it.
Parameters
None
Returns
Variant
pop_front Variant
Removes the first element from the LuaTuple's stack and returns it.
Parameters
None
Returns
Variant
push_back void
Adds a value to the end of the LuaTuple's stack.
Parameters
Parameters | Description |
---|---|
value: Variant |
The value to be added to the stack. |
Returns
void
push_front void
Adds a value to the start of the LuaTuple's stack.
Parameters
Parameters | Description |
---|---|
variableName: String |
The name of the Lua variable to read. |
Returns
void
set_value void
Sets the value at the specified index in the LuaTuple's stack.
Parameters
Parameters | Description |
---|---|
index: number |
An integer representing the index. |
value: Variant |
The value to be set. |
Returns
void
size number
Returns the number of elements in the LuaTuple's stack.
Parameters
None
Returns
number
to_array array
Converts the LuaTuple's stack to an array.
Parameters
None
Returns
array
Example
["Hello!", " How are you?", " I havent seen you in ", 10, " days."] -- <LuaAPI#-9223372010447437394>