leef-class-cd2025/docs/class/new_class.html

133 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<!-- Documentation generated by LuaDox: https://github.com/jtackaberry/luadox -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>new_class - MTUL-class</title>
<link href="../prism.css?7653a2d" rel="stylesheet" />
<link rel="stylesheet" href="../luadox.css?7653a2d" type="text/css">
</head>
<body class="class-new_class">
<div class="topbar">
<div class="group one">
<div class="description"><span>MTUL-class | implementation of classes and immutable tables in lua (for minetest)</span></div>
</div>
<div class="group two">
</div>
<div class="group three">
</div>
</div>
<div class="sidebar">
<form action="../search.html">
<input class="search" name="q" type="search" placeholder="Search" />
</form>
<div class="sections">
<div class="heading">Contents</div>
<ul>
<li><a href="#new_class">Class <code>new_class</code></a></li>
</ul>
</div>
<div class="classes">
<div class="heading">Classes</div>
<ul>
<li class="selected"><a href="../class/new_class.html">new_class.new_class</a></li>
</ul>
</div>
</div>
<div class="body">
<div class="section">
<h2 class="class" id="new_class">Class <code>new_class</code>
<a class="permalink" href="#new_class" title="Permalink to this definition"></a>
</h2>
<div class="inner">
<p>An instantiatable class to inherit for defining new instantiatble classes classes
the &quot;base&quot; class. To make a new class call <code>new_class:inherit(your_new_class)</code>.
also note that these classes will not have the type &quot;table&quot; but &quot;class&quot;.</p>
<div class="synopsis">
<h3>Synopsis</h3>
<div class="heading">Fields</div>
<table class="fields ">
<tr>
<td class="name"><a href="#new_class.instance"><var>instance</var></a></td>
<td class="doc"><p>defines wether the object is an instance, use this in construction to determine what changes to make</p>
</td>
</tr>
<tr>
<td class="name"><a href="#new_class.base_class"><var>base_class</var></a></td>
<td class="doc"><p>only present for instances: the class from which this instance originates</p>
</td>
</tr>
<tr>
<td class="name"><a href="#new_class.parent_class"><var>parent_class</var></a></td>
<td class="doc"><p>the class from which this class was inherited from</p>
</td>
</tr>
</table>
<div class="heading">Methods</div>
<table class="functions ">
<tr>
<td class="name"><a href="#mtul.class.new_class.inherit"><var>mtul.class.new_class:inherit</var></a>()</td>
<td class="doc"><p>creates a new base class</p>
</td>
</tr>
<tr>
<td class="name"><a href="#mtul.class.new_class.new"><var>mtul.class.new_class:new</var></a>()</td>
<td class="doc"><p>creates an instance of the base class</p>
</td>
</tr>
</table>
</div>
<h3 class="fields">Fields</h3>
<dl class="fields">
<dt id="new_class.instance">
<span class="icon"></span><var>new_class.instance</var>
<a class="permalink" href="#new_class.instance" title="Permalink to this definition"></a>
</dt>
<dd>
<p>defines wether the object is an instance, use this in construction to determine what changes to make</p>
</dd>
<dt id="new_class.base_class">
<span class="icon"></span><var>new_class.base_class</var>
<a class="permalink" href="#new_class.base_class" title="Permalink to this definition"></a>
</dt>
<dd>
<p>only present for instances: the class from which this instance originates</p>
</dd>
<dt id="new_class.parent_class">
<span class="icon"></span><var>new_class.parent_class</var>
<a class="permalink" href="#new_class.parent_class" title="Permalink to this definition"></a>
</dt>
<dd>
<p>the class from which this class was inherited from</p>
</dd>
</dl>
<h3 class="functions">Methods</h3>
<dl class="functions">
<dt id="mtul.class.new_class.inherit">
<span class="icon"></span><var>mtul.class.new_class:inherit</var>(<em>def</em>)
<a class="permalink" href="#mtul.class.new_class.inherit" title="Permalink to this definition"></a>
</dt>
<dd>
<p>creates a new base class. Calls all constructors in the chain with def.instance=true</p>
</dd>
<dt id="mtul.class.new_class.new">
<span class="icon"></span><var>mtul.class.new_class:new</var>(<em>def</em>)
<a class="permalink" href="#mtul.class.new_class.new" title="Permalink to this definition"></a>
</dt>
<dd>
<p>creates an instance of the base class. Calls all constructors in the chain with def.instance=true</p>
</dd>
</dl>
</div>
</div>
</div>
<script src="../prism.js?7653a2d"></script>
</body>
</html>