Class LuaArrayHelper

java.lang.Object
games.stendhal.server.core.scripting.lua.LuaArrayHelper

public class LuaArrayHelper extends Object
Handles some conversion of Java arrays to Lua tables.
  • Method Details

    • get

      public static LuaArrayHelper get()
      Retrieves the static instance.
      Returns:
      Static ArraysHelper instance.
    • toTable

      public org.luaj.vm2.LuaTable toTable(Object[] list)
      Creates a Lua table from a Java array.
      Parameters:
      list - Array containing values.
      Returns:
      New LuaTable.
    • toTable

      public org.luaj.vm2.LuaTable toTable(List<Object> list)
      Creates a Lua table from a Java list.
      Parameters:
      list - List containing values.
      Returns:
      New LuaTable.
    • toList

      public List<Object> toList(org.luaj.vm2.LuaTable table)
      Converts a Lua table to Java list.
      Parameters:
      table - Table with contents to be transferred to new list.
      Returns:
      New List instance.
    • toArray

      public Object[] toArray(org.luaj.vm2.LuaTable table)
      Converts a Lua table to Java array.
      Parameters:
      table - Table with contents to be transferred to new array.
      Returns:
      New Object[] instance.