stendhal/doc/mkdocs/lua/objects/arrays.md
2023-05-17 02:08:58 -07:00

2.1 KiB


Contents

[TOC]


Introduction

Object instance: arrays


Description

Handles some conversion between Java arrays or lists & Lua tables.


Methods


arrays:fromTable

arrays:fromTable (table)
  • Converts an indexed table to Java array.
  • Parameters:
    • table: (table) Table with contents to be transferred to new array.
  • Returns: New Object[] instance.

arrays:toArray

arrays:toArray (table)
  • DEPRECATED: Use arrays:fromTable.
  • Converts an indexed table to Java array.
  • Parameters:
    • table: (table) Table with contents to be transferred to new array.
  • Returns: New Object[] instance.

arrays:toList

arrays:toList (table)
  • Converts an indexed table to Java List.
  • Parameters:
    • table: (table) Table with contents to be transferred to new list.
  • Returns: New List instance.
  • TODO:
    • FIXME: this should be in tables

arrays:toTable

arrays:toTable (list)
  • Converts a Java array or List to Lua table.
  • Parameters:
    • list: Java array or List.
  • Returns: New table with contents of list added.