LuaCallableExtra
Description
A wrapper for Callables used to create functions that accept either any amount of arguments from Lua as a single LuaTuple parameter or that accept a reference to the LuaAPI object from which the method was invoked, or both.
Properties
argc number
An integer representing the number of expected arguments.
tuple bool
Wether or not the last parameter should be of the type LuaTuple.
wants_ref bool
Wether or not the method expects a reference to the LuaAPI object that invoked it.
Methods
with_ref LuaCallableExtra
Static method that creates a LuaCallableExtra. A reference to the LuaAPI object that invoked the method will be passed as an argument to the callable.
Parameters
Parameters | Description |
---|---|
callable: Callable |
The associated callable. |
Returns
LuaCallableExtra
Example
with_tuple LuaCallableExtra
Static method that creates a LuaCallableExtra. A reference to the LuaAPI object that invoked the method will be passed as an argument to the callable. By specifying the number of expected arguments in this function, the module will be able to add all, if any, extra arguments to a LuaTuple, which will always be the last parameter.
Parameters
Parameters | Description |
---|---|
callable: Callable |
The associated callable. |
arg count: number |
The number of expected arguments excluding the tuple one. |
Returns
LuaCallableExtra
Example
with_ref_and_tuple LuaCallableExtra
Static method that creates a LuaCallableExtra. By specifying the number of expected arguments in this function, the module will be able to add all, if any, extra arguments to a LuaTuple, which will always be the last parameter.
Note
This method is similar to with_ref and with_tuple combined.
Parameters
Parameters | Description |
---|---|
callable: Callable |
The associated callable. |
arg count: number |
The number of expected arguments excluding the tuple one. |
Returns
LuaCallableExtra
Example
set_info void
Alternative way to configure a LuaCallableExtra. This method is particularly useful for methods that expect both a LuaTuple and a reference to the LuaAPI object.
Parameters
Parameters | Description |
---|---|
callable: Callable |
The associated callable. |
arg count: number |
The number of expected arguments excluding the tuple one. |
isTuple: bool |
Wether or not the last parameter should be of the type LuaTuple. |
wantsRef: bool |
Wether or not to pass a reference to the LuaAPI object. |
Returns
void