379 lines
6.1 KiB
HTML
379 lines
6.1 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/list.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><strong>utils/list.lua</strong></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>
|
|
<a href="../../files/utils/tableutil.html">utils/tableutil.lua</a>
|
|
</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/list.lua</code></h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Functions</h2>
|
|
<table class="function_list">
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:add">List:add</a> (...)</td>
|
|
<td class="summary">Adds the given item to the list.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:clear">List:clear</a> ()</td>
|
|
<td class="summary">Clears all entries from the list.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:foreach">List:foreach</a> (action)</td>
|
|
<td class="summary">Iterates over all items in the list and invokes the given action on them.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:get">List:get</a> (index)</td>
|
|
<td class="summary">Gets the item at the given index.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:new">List:new</a> (one_indexed)</td>
|
|
<td class="summary">Creates a new instance of List.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:size">List:size</a> ()</td>
|
|
<td class="summary">Gets the size of the list.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="name" nowrap><a href="#List:to_table">List:to_table</a> ()</td>
|
|
<td class="summary">Turns this list into a table, the return table will be a zero indexed array, and can freely be modified as it is not the table used by this instance.</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<h2><a name="functions"></a>Functions</h2>
|
|
<dl class="function">
|
|
|
|
|
|
|
|
<dt><a name="List:add"></a><strong>List:add</strong> (...)</dt>
|
|
<dd>
|
|
Adds the given item to the list.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
...: The items to add.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:clear"></a><strong>List:clear</strong> ()</dt>
|
|
<dd>
|
|
Clears all entries from the list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:foreach"></a><strong>List:foreach</strong> (action)</dt>
|
|
<dd>
|
|
Iterates over all items in the list and invokes the given action on them.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
action: The function to invoke on the item, the first parameter will be the item itself, the second (optional) parameter is the index.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:get"></a><strong>List:get</strong> (index)</dt>
|
|
<dd>
|
|
Gets the item at the given index. Returns nil if there is no item. Note that there is no different between "no item" and "nil is the item", in both cases nil is returned.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
index: The index of the item to get.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The item at the given index. nil if there is no item.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:new"></a><strong>List:new</strong> (one_indexed)</dt>
|
|
<dd>
|
|
Creates a new instance of List.
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
|
|
<li>
|
|
one_indexed: Optional. true if the list should be one indexed instead of zero indexed.
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
A new instance of List.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:size"></a><strong>List:size</strong> ()</dt>
|
|
<dd>
|
|
Gets the size of the list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
The size of the list.
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt><a name="List:to_table"></a><strong>List:to_table</strong> ()</dt>
|
|
<dd>
|
|
Turns this list into a table, the return table will be a zero indexed array, and can freely be modified as it is not the table used by this instance. However the items in the returned table are not copies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Return value:</h3>
|
|
This list as 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>
|