2016-05-27 13:41:51 +02:00

533 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.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>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="Base.html">Base</a></li>
<li><a href="CARGO.html">CARGO</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DEPLOYTASK.html">DEPLOYTASK</a></li>
<li><a href="DESTROYBASETASK.html">DESTROYBASETASK</a></li>
<li><a href="DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
<li><a href="DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
<li><a href="DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="GroupSet.html">GroupSet</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
<li><a href="STAGE.html">STAGE</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li>Set</li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UnitSet.html">UnitSet</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Set</code></h1>
<p>Manage sets of units and groups.</p>
<h1><a href="##(Set)">#Set</a> class</h1>
<p>Mission designers can use the SET class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Unit types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<p>This list will grow over time. Planned developments are to include filters and iterators.
Additional filters will be added around <a href="Zone.html##(ZONEs)">Zone#ZONEs</a>, Radiuses, Active players, ...
More iterators will be implemented in the near future ...</p>
<p>Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.</p>
<h1>SET construction methods:</h1>
<p>Create a new SET object with the <a href="##(SET).New">SET.New</a> method:</p>
<ul>
<li><a href="##(SET).New">SET.New</a>: Creates a new SET object.</li>
</ul>
<h1>SET filter criteria: </h1>
<p>You can set filter criteria to define the set of units within the SET.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET).FilterCoalitions">SET.FilterCoalitions</a>: Builds the SET with the units belonging to the coalition(s).</li>
<li><a href="##(SET).FilterCategories">SET.FilterCategories</a>: Builds the SET with the units belonging to the category(ies).</li>
<li><a href="##(SET).FilterTypes">SET.FilterTypes</a>: Builds the SET with the units belonging to the unit type(s).</li>
<li><a href="##(SET).FilterCountries">SET.FilterCountries</a>: Builds the SET with the units belonging to the country(ies).</li>
<li><a href="##(SET).FilterUnitPrefixes">SET.FilterUnitPrefixes</a>: Builds the SET with the units starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET, you can start filtering using:</p>
<ul>
<li><a href="##(SET).FilterStart">SET.FilterStart</a>: Starts the filtering of the units within the SET.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET).FilterGroupPrefixes">SET.FilterGroupPrefixes</a>: Builds the SET with the groups of the units starting with the same prefix string(s).</li>
<li><a href="##(SET).FilterZones">SET.FilterZones</a>: Builds the SET with the units within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h1>SET iterators:</h1>
<p>Once the filters have been defined and the SET has been built, you can iterate the SET with the available iterator methods.
The iterator methods will walk the SET set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET:</p>
<ul>
<li><a href="##(SET).ForEachAliveUnit">SET.ForEachAliveUnit</a>: Calls a function for each alive unit it finds within the SET.</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET).ForEachUnit">SET.ForEachUnit</a>: Calls a function for each unit contained within the SET.</li>
<li><a href="##(SET).ForEachGroup">SET.ForEachGroup</a>: Calls a function for each group contained within the SET.</li>
<li><a href="##(SET).ForEachUnitInZone">SET.ForEachUnitInZone</a>: Calls a function for each unit within a certain zone contained within the SET.</li>
</ul>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#SET">SET</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(SET)">Type <code>SET</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).ClassName">SET.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).Database">SET.Database</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).Flush">SET:Flush()</a></td>
<td class="summary">
<p>Flushes the current SET contents in the log ...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).ForEach">SET:ForEach(IteratorFunction, arg, Set)</a></td>
<td class="summary">
<p>Interate the SET and call an interator function for the given set, providing the Object for each element within the set and optional parameters.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).IsIncludeObject">SET:IsIncludeObject(Object)</a></td>
<td class="summary">
<p>Decides whether to include the Object</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).New">SET:New(Database)</a></td>
<td class="summary">
<p>Creates a new SET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET).Set">SET.Set</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET)._Add">SET:_Add(ObjectName, Object)</a></td>
<td class="summary">
<p>Adds a Object based on the Object Name.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET)._EventOnBirth">SET:_EventOnBirth(Event)</a></td>
<td class="summary">
<p>Handles the OnBirth event for the Set.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET)._EventOnDeadOrCrash">SET:_EventOnDeadOrCrash(Event)</a></td>
<td class="summary">
<p>Handles the OnDead or OnCrash event for alive units set.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET)._FilterStart">SET:_FilterStart()</a></td>
<td class="summary">
<p>Starts the filtering for the defined collection.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET)._Find">SET:_Find(ObjectName)</a></td>
<td class="summary">
<p>Finds an Object based on the Object Name.</p>
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(SET)">#SET</a></em>
<a id="SET" >
<strong>SET</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Set)" >Type <code>Set</code></a></h2>
<h2><a id="#(SET)" >Type <code>SET</code></a></h2>
<p>SET class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(SET).ClassName" >
<strong>SET.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SET).Database" >
<strong>SET.Database</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET).Flush" >
<strong>SET:Flush()</strong>
</a>
</dt>
<dd>
<p>Flushes the current SET contents in the log ...</p>
<p>(for debug reasons).</p>
<h3>Return value</h3>
<p><em>#string:</em>
A string with the names of the objects.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET).ForEach" >
<strong>SET:ForEach(IteratorFunction, arg, Set)</strong>
</a>
</dt>
<dd>
<p>Interate the SET and call an interator function for the given set, providing the Object for each element within the set and optional parameters.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function IteratorFunction </em></code>:
The function that will be called when there is an alive player in the SET.</p>
</li>
<li>
<p><code><em> arg </em></code>: </p>
</li>
<li>
<p><code><em> Set </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SET)">#SET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET).IsIncludeObject" >
<strong>SET:IsIncludeObject(Object)</strong>
</a>
</dt>
<dd>
<p>Decides whether to include the Object</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table Object </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SET)">#SET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET).New" >
<strong>SET:New(Database)</strong>
</a>
</dt>
<dd>
<p>Creates a new SET object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Database </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SET)">#SET</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define a new SET Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
DBObject = SET:New()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SET).Set" >
<strong>SET.Set</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET)._Add" >
<strong>SET:_Add(ObjectName, Object)</strong>
</a>
</dt>
<dd>
<p>Adds a Object based on the Object Name.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string ObjectName </em></code>: </p>
</li>
<li>
<p><code><em>#table Object </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#table:</em>
The added Object.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET)._EventOnBirth" >
<strong>SET:_EventOnBirth(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the OnBirth event for the Set.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET)._EventOnDeadOrCrash" >
<strong>SET:_EventOnDeadOrCrash(Event)</strong>
</a>
</dt>
<dd>
<p>Handles the OnDead or OnCrash event for alive units set.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET)._FilterStart" >
<strong>SET:_FilterStart()</strong>
</a>
</dt>
<dd>
<p>Starts the filtering for the defined collection.</p>
<h3>Return value</h3>
<p><em><a href="##(SET)">#SET</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET)._Find" >
<strong>SET:_Find(ObjectName)</strong>
</a>
</dt>
<dd>
<p>Finds an Object based on the Object Name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string ObjectName </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#table:</em>
The Object found.</p>
</dd>
</dl>
</div>
</div>
</body>
</html>