Appearance
NamedTupleList
Inherits: Class
Methods
GetNumRows
lua
function NamedTupleList:GetNumRows()
-> numberGets the number of rows in the list.
Returns:
| Type | Description |
|---|---|
number |
GetRow
lua
function NamedTupleList:GetRow(rowIndex)
-> ...anyGets the data for a given row.
Parameters:
| Name | Type | Description |
|---|---|---|
rowIndex | number | The row index |
Returns:
| Type | Description |
|---|---|
...any |
GetRowField
lua
function NamedTupleList:GetRowField(rowIndex, fieldName)
-> anyGets a single field for a given row.
Parameters:
| Name | Type | Description |
|---|---|---|
rowIndex | number | The row index |
fieldName | string | The name of the field |
Returns:
| Type | Description |
|---|---|
any |
InsertRow
lua
function NamedTupleList:InsertRow(...)
-> numberInsert a row into the list and returns its index.
Parameters:
| Name | Type | Description |
|---|---|---|
... | any | The row values |
Returns:
| Type | Description |
|---|---|
number |
Iterator
lua
function NamedTupleList:Iterator()
-> fun():number, ...any, table, numberIterates over each row in the list.
Returns:
| Type | Description |
|---|---|
fun():number, ...any | Iterator with fields: rowIndex, ... |
table | |
number |
RemoveRow
lua
function NamedTupleList:RemoveRow(rowIndex)Removes a row at a given index. NOTE: This will invalidate other row indexes.
Parameters:
| Name | Type | Description |
|---|---|---|
rowIndex | number | The row index |
SetRowField
lua
function NamedTupleList:SetRowField(rowIndex, fieldName, value)Sets a single field for a given row.
Parameters:
| Name | Type | Description |
|---|---|---|
rowIndex | number | The row index |
fieldName | string | The name of the field |
value | any | The field value |
Wipe
lua
function NamedTupleList:Wipe()Wipes the list.
Functions
New
lua
function NamedTupleList.New(...)
-> NamedTupleListCreates a new named tuple list.
Parameters:
| Name | Type | Description |
|---|---|---|
... | string | The tuple field names, in order |
Returns:
| Type | Description |
|---|---|
NamedTupleList |