Class LuaValueMapper

java.lang.Object
dev.selena.luacore.utils.lua.LuaValueMapper

public class LuaValueMapper extends Object
Used for mapping Lua values to a class Note there is still a bit of work needed here
  • Constructor Details

    • LuaValueMapper

      public LuaValueMapper()
  • Method Details

    • loadTable

      public static org.luaj.vm2.LuaTable loadTable(String scriptPath) throws NoReturnValueException
      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

      public static <T> T mapToClass(Class<T> cls, String scriptPath) throws NoReturnValueException
      Used for mapping lua values to the class
      Type Parameters:
      T - The mapper class
      Parameters:
      cls - The class you want to map to
      scriptPath - The path to the script
      Returns:
      The mapped class instance
      Throws:
      NoReturnValueException - Thrown when there is no lua return table