public interface ILuaObject
IPeripheral.callMethod(IComputerAccess, ILuaContext, int, Object[])
calls.
Return objects implementing this interface to expose objects with methods to lua.Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
callMethod(ILuaContext context,
int method,
java.lang.Object[] arguments)
Called when a user calls one of the methods that this object implements.
|
java.lang.String[] |
getMethodNames()
Get the names of the methods that this object implements.
|
java.lang.String[] getMethodNames()
IPeripheral.getMethodNames()
.
See that method for detailed documentation.IPeripheral.getMethodNames()
java.lang.Object[] callMethod(ILuaContext context, int method, java.lang.Object[] arguments) throws LuaException, java.lang.InterruptedException
IPeripheral.callMethod(IComputerAccess, ILuaContext, int, Object[])
}. See that method for detailed
documentation.context
- The context of the currently running lua thread. This can be used to wait for events
or otherwise yield.method
- An integer identifying which of the methods from getMethodNames() the computercraft
wishes to call. The integer indicates the index into the getMethodNames() table
that corresponds to the string passed into peripheral.call()arguments
- The arguments for this method. See IPeripheral.callMethod(IComputerAccess, ILuaContext, int, Object[])
the possible values and conversion rules.IPeripheral.callMethod(IComputerAccess, ILuaContext, int, Object[])
for the valid values and
conversion rules.LuaException
- If the task could not be queued, or if the task threw an exception.java.lang.InterruptedException
- If the user shuts down or reboots the computer the coroutine is suspended,
InterruptedException will be thrown. This exception must not be caught or
intercepted, or the computer will leak memory and end up in a broken state.wIPeripheral.callMethod(IComputerAccess, ILuaContext, int, Object[])