479 lines
7.7 KiB
HTML
479 lines
7.7 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Luadocs for utils/tableutil.lua</title>
|
|
<link rel="stylesheet" href="../../luadoc.css" type="text/css" />
|
|
<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
|
|
</head>
|
|
|
|
<body>
|
|
<div id="container">
|
|
|
|
<div id="product">
|
|
<div id="product_logo"></div>
|
|
<div id="product_name"><big><b></b></big></div>
|
|
<div id="product_description"></div>
|
|
</div> <!-- id="product" -->
|
|
|
|
<div id="main">
|
|
|
|
<div id="navigation">
|
|
|
|
|
|
<h1>LuaDoc</h1>
|
|
<ul>
|
|
|
|
<li><a href="../../index.html">Index</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
<!-- Module list -->
|
|
|
|
|
|
|
|
<!-- File list -->
|
|
|
|
<h1>Files</h1>
|
|
<ul>
|
|
|
|
<li>
|
|
<a href="../../files/utils/blockedcache.html">utils/blockedcache.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/blockutil.html">utils/blockutil.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/color.html">utils/color.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/constants.html">utils/constants.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/fisheryates.html">utils/fisheryates.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/init.html">utils/init.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/interpolate.html">utils/interpolate.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/inventoryutil.html">utils/inventoryutil.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/list.html">utils/list.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/log.html">utils/log.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/mapmanipulator.html">utils/mapmanipulator.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/mathutil.html">utils/mathutil.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/noisemanager.html">utils/noisemanager.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/pathutil.html">utils/pathutil.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/stopwatch.html">utils/stopwatch.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/stringutil.html">utils/stringutil.lua</a>
|
|
</li>
|
|
|
|
<li><strong>utils/tableutil.lua</strong></li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/tango.html">utils/tango.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/test.html">utils/test.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/textureutil.html">utils/textureutil.lua</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="../../files/utils/transform.html">utils/transform.lua</a>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> <!-- id="navigation" -->
|
|
|
|
<div id="content">
|
|
|
|
<h1>File <code>utils/tableutil.lua</code></h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Functions</h2>
|
|
<table class="function_list">
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.clone">tableutil.clone</a> (table)</td>
|
|
<td class="summary">Performs a deep/recursive clone on the given table.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.equals">tableutil.equals</a> (a, b)</td>
|
|
<td class="summary">Tests the two given tables for equality.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.keys">tableutil.keys</a> (...)</td>
|
|
<td class="summary">Returns a (unique) list with all keys of all tables.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.merge">tableutil.merge</a> (...)</td>
|
|
<td class="summary">Merges the given tables into one instance.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.reduce2d">tableutil.reduce2d</a> (table, is_empty)</td>
|
|
<td class="summary">Removes empty rows and columns at the beginning and the end of teh given 2D table.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.swapped_reindex2d">tableutil.swapped_reindex2d</a> (data, new_x, new_y)</td>
|
|
<td class="summary">Reindexes the given 2d array/table, swapping the two dimensions.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.swapped_reindex3d">tableutil.swapped_reindex3d</a> (data, new_x, new_y, new_z)</td>
|
|
<td class="summary">Reindexes the given 3d array/table, swapping the two dimensions.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#tableutil.to_string">tableutil.to_string</a> (table, indent)</td>
|
|
<td class="summary">Returns the string representation of the given table.</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<h2><a name="functions"></a>Functions</h2>
|
|
<dl class="function">
|
|
|
|
|
|
|
|
<dt><a name="tableutil.clone"></a><strong>tableutil.clone</strong> (table)</dt>
|
|
<dd>
|
|
Performs a deep/recursive clone on the given table.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
table: The table to deep clone.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The clone of the table.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.equals"></a><strong>tableutil.equals</strong> (a, b)</dt>
|
|
<dd>
|
|
Tests the two given tables for equality.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
a: The first table.
|
|
</li>
|
|
|
|
<li>
|
|
b: The second table.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.keys"></a><strong>tableutil.keys</strong> (...)</dt>
|
|
<dd>
|
|
Returns a (unique) list with all keys of all tables.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
...: The list of tables.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
A list with all keys.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.merge"></a><strong>tableutil.merge</strong> (...)</dt>
|
|
<dd>
|
|
Merges the given tables into one instance. Note that no cloning is performed so fields may refer to the same instances.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
...: The tables to merge.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The merged table.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.reduce2d"></a><strong>tableutil.reduce2d</strong> (table, is_empty)</dt>
|
|
<dd>
|
|
Removes empty rows and columns at the beginning and the end of teh given 2D table.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
table: The 2D table.
|
|
</li>
|
|
|
|
<li>
|
|
is_empty: Optional. The function used for determining if the item is empty. By default nil and an empty string is considered empty. Expected is a function that takes one item and returns a boolean.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.swapped_reindex2d"></a><strong>tableutil.swapped_reindex2d</strong> (data, new_x, new_y)</dt>
|
|
<dd>
|
|
Reindexes the given 2d array/table, swapping the two dimensions.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
data: The array/table to reindex.
|
|
</li>
|
|
|
|
<li>
|
|
new_x: The new startpoint for the first dimension.
|
|
</li>
|
|
|
|
<li>
|
|
new_y: The new startpoint for the second dimension.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The reindexed data.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.swapped_reindex3d"></a><strong>tableutil.swapped_reindex3d</strong> (data, new_x, new_y, new_z)</dt>
|
|
<dd>
|
|
Reindexes the given 3d array/table, swapping the two dimensions.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
data: The array/table to reindex.
|
|
</li>
|
|
|
|
<li>
|
|
new_x: The new startpoint for the first dimension.
|
|
</li>
|
|
|
|
<li>
|
|
new_y: The new startpoint for the second dimension.
|
|
</li>
|
|
|
|
<li>
|
|
new_z: The new startpoint for the third dimension.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The reindexed data.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="tableutil.to_string"></a><strong>tableutil.to_string</strong> (table, indent)</dt>
|
|
<dd>
|
|
Returns the string representation of the given table.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
table: The table.
|
|
</li>
|
|
|
|
<li>
|
|
indent: Optional. The number of spaces of indentation.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The string representation of the given table.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
|
|
</div> <!-- id="main" -->
|
|
|
|
<div id="about">
|
|
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
|
|
</div> <!-- id="about" -->
|
|
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|