Package dev.selena.luacore.utils.lua
Class LuaValueMapper
java.lang.Object
dev.selena.luacore.utils.lua.LuaValueMapper
Used for mapping Lua values to a class
Note there is still a bit of work needed here
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.luaj.vm2.LuaTable
Used for loading a Lua table into memorystatic <T> T
mapToClass
(Class<T> cls, String scriptPath) Used for mapping lua values to the class
-
Constructor Details
-
LuaValueMapper
public LuaValueMapper()
-
-
Method Details
-
loadTable
Used for loading a Lua table into memory- Parameters:
scriptPath
- The path to the script- Returns:
- The Lua Table for the script returns
- Throws:
NoReturnValueException
- Thrown when there is no lua return table
-
mapToClass
Used for mapping lua values to the class- Type Parameters:
T
- The mapper class- Parameters:
cls
- The class you want to map toscriptPath
- The path to the script- Returns:
- The mapped class instance
- Throws:
NoReturnValueException
- Thrown when there is no lua return table
-