guns4d-cd2025/autogen_docs/classes/Instantiatable_class.html

202 lines
4.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>4dguns documentation</title>
<link rel="stylesheet" href="../ldoc_new.css" type="text/css" />
</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">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>4dguns</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Methods">Methods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><strong>Instantiatable_class</strong></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/Gun.html">Gun</a></li>
<li><a href="../modules/default_controls.html">default_controls</a></li>
</ul>
<h2>Scripts</h2>
<ul class="nowrap">
<li><a href="../scripts/item_entities.lua.html">item_entities.lua</a></li>
<li><a href="../scripts/misc_helpers.html">misc_helpers</a></li>
<li><a href="../scripts/play_sound.html">play_sound</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/readme.md.html">readme</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Instantiatable_class</code></h1>
<p>Instantiatable_class.</p>
<p> The system for defining classes in 4dguns. Please note the capital "I", Ldoc converts it to a lowercase in all of this file</p>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#instantiatable_class.god_work">instantiatable_class.god_work</a></td>
<td class="summary">Instantiatable_class</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#instantiatable_class:inherit">instantiatable_class:inherit (def)</a></td>
<td class="summary">creates a new base class.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#instantiatable_class:construct">instantiatable_class:construct ()</a></td>
<td class="summary">construct
every parent constructor is called in order of inheritance, this is used to make changes to the child table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#instantiatable_class:new">instantiatable_class:new ()</a></td>
<td class="summary">creates an instance of the base class.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "instantiatable_class.god_work"></a>
<strong>instantiatable_class.god_work</strong>
</dt>
<dd>
Instantiatable_class
<h3>Fields:</h3>
<ul>
<li><span class="parameter">instance</span>
defines wether the object is an instance
</li>
<li><span class="parameter">base_class</span>
only present for instances: the class from which this instance originates
</li>
<li><span class="parameter">parent_class</span>
the class from which this class was inherited from
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "instantiatable_class:inherit"></a>
<strong>instantiatable_class:inherit (def)</strong>
</dt>
<dd>
creates a new base class. Calls all constructors in the chain with def.instance=true
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">def</span>
the table containing a new definition (where the class calling the method is the parent). The content of the definition will override the fields for it's children.
</li>
</ul>
<h3>Returns:</h3>
<ol>
def a new base class
</ol>
</dd>
<dt>
<a name = "instantiatable_class:construct"></a>
<strong>instantiatable_class:construct ()</strong>
</dt>
<dd>
construct
every parent constructor is called in order of inheritance, this is used to make changes to the child table. In self you will find base_class defining what class it is from, and the bool instance indicating (shocking) wether it is an instance.
</dd>
<dt>
<a name = "instantiatable_class:new"></a>
<strong>instantiatable_class:new ()</strong>
</dt>
<dd>
creates an instance of the base class. Calls all constructors in the chain with def.instance=true
<h3>Returns:</h3>
<ol>
def a new instance of the class.
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/ldoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2024-03-28 12:47:10 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>