mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Documentation refinement of Core Classes
This commit is contained in:
parent
343de7fe69
commit
ac0effe141
@ -1,34 +1,66 @@
|
||||
--- This module contains the BASE class.
|
||||
--- **Core** - BASE forms **the basis of the MOOSE framework**. Each class within the MOOSE framework derives from BASE.
|
||||
--
|
||||
-- 1) @{#BASE} class
|
||||
-- =================
|
||||
-- The @{#BASE} class is the super class for all the classes defined within MOOSE.
|
||||
-- 
|
||||
--
|
||||
-- It handles:
|
||||
-- ===
|
||||
--
|
||||
-- * The construction and inheritance of child classes.
|
||||
-- * The tracing of objects during mission execution within the **DCS.log** file, under the **"Saved Games\DCS\Logs"** folder.
|
||||
-- # 1) @{#BASE} class
|
||||
--
|
||||
-- Note: Normally you would not use the BASE class unless you are extending the MOOSE framework with new classes.
|
||||
-- All classes within the MOOSE framework are derived from the @{#BASE} class.
|
||||
--
|
||||
-- BASE provides facilities for :
|
||||
--
|
||||
-- * The construction and inheritance of MOOSE classes.
|
||||
-- * The class naming and numbering system.
|
||||
-- * The class hierarchy search system.
|
||||
-- * The tracing of information or objects during mission execution for debuggin purposes.
|
||||
-- * The subscription to DCS events for event handling in MOOSE objects.
|
||||
--
|
||||
-- Note: The BASE class is an abstract class and is not meant to be used directly.
|
||||
--
|
||||
-- ## 1.1) BASE constructor
|
||||
--
|
||||
-- Any class derived from BASE, must use the @{Base#BASE.New) constructor within the @{Base#BASE.Inherit) method.
|
||||
-- See an example at the @{Base#BASE.New} method how this is done.
|
||||
--
|
||||
-- ## 1.2) BASE Trace functionality
|
||||
-- ## 1.2) Trace information for debugging
|
||||
--
|
||||
-- The BASE class contains trace methods to trace progress within a mission execution of a certain object.
|
||||
-- Note that these trace methods are inherited by each MOOSE class interiting BASE.
|
||||
-- As such, each object created from derived class from BASE can use the tracing functions to trace its execution.
|
||||
-- These trace methods are inherited by each MOOSE class interiting BASE, soeach object created from derived class from BASE can use the tracing methods to trace its execution.
|
||||
--
|
||||
-- ### 1.2.1) Tracing functions
|
||||
-- Any type of information can be passed to these tracing methods. See the following examples:
|
||||
--
|
||||
-- self:E( "Hello" )
|
||||
--
|
||||
-- Result in the word "Hello" in the dcs.log.
|
||||
--
|
||||
-- local Array = { 1, nil, "h", { "a","b" }, "x" }
|
||||
-- self:E( Array )
|
||||
--
|
||||
-- Results with the text [1]=1,[3]="h",[4]={[1]="a",[2]="b"},[5]="x"} in the dcs.log.
|
||||
--
|
||||
-- local Object1 = "Object1"
|
||||
-- local Object2 = 3
|
||||
-- local Object3 = { Object 1, Object 2 }
|
||||
-- self:E( { Object1, Object2, Object3 } )
|
||||
--
|
||||
-- Results with the text [1]={[1]="Object",[2]=3,[3]={[1]="Object",[2]=3}} in the dcs.log.
|
||||
--
|
||||
-- local SpawnObject = SPAWN:New( "Plane" )
|
||||
-- local GroupObject = GROUP:FindByName( "Group" )
|
||||
-- self:E( { Spawn = SpawnObject, Group = GroupObject } )
|
||||
--
|
||||
-- Results with the text [1]={Spawn={....),Group={...}} in the dcs.log.
|
||||
--
|
||||
-- Below a more detailed explanation of the different method types for tracing.
|
||||
--
|
||||
-- ### 1.2.1) Tracing methods categories
|
||||
--
|
||||
-- There are basically 3 types of tracing methods available within BASE:
|
||||
-- There are basically 3 types of tracing methods available:
|
||||
--
|
||||
-- * @{#BASE.F}: Trace the beginning of a function and its given parameters. An F is indicated at column 44 in the DCS.log file.
|
||||
-- * @{#BASE.T}: Trace further logic within a function giving optional variables or parameters. A T is indicated at column 44 in the DCS.log file.
|
||||
-- * @{#BASE.E}: Trace an exception within a function giving optional variables or parameters. An E is indicated at column 44 in the DCS.log file. An exception will always be traced.
|
||||
-- * @{#BASE.F}: Used to trace the entrance of a function and its given parameters. An F is indicated at column 44 in the DCS.log file.
|
||||
-- * @{#BASE.T}: Used to trace further logic within a function giving optional variables or parameters. A T is indicated at column 44 in the DCS.log file.
|
||||
-- * @{#BASE.E}: Used to always trace information giving optional variables or parameters. An E is indicated at column 44 in the DCS.log file.
|
||||
--
|
||||
-- ### 1.2.2) Tracing levels
|
||||
--
|
||||
@ -51,6 +83,7 @@
|
||||
-- * Activate only the tracing of a certain class (name) through the @{#BASE.TraceClass}() method.
|
||||
-- * Activate only the tracing of a certain method of a certain class through the @{#BASE.TraceClassMethod}() method.
|
||||
-- * Activate only the tracing of a certain level through the @{#BASE.TraceLevel}() method.
|
||||
--
|
||||
-- ### 1.2.4) Check if tracing is on.
|
||||
--
|
||||
-- The method @{#BASE.IsTrace}() will validate if tracing is activated or not.
|
||||
@ -64,7 +97,7 @@
|
||||
--
|
||||
-- At first, the mission designer will need to **Subscribe** to a specific DCS event for the class.
|
||||
-- So, when the DCS event occurs, the class will be notified of that event.
|
||||
-- There are two functions which you use to subscribe to or unsubscribe from an event.
|
||||
-- There are two methods which you use to subscribe to or unsubscribe from an event.
|
||||
--
|
||||
-- * @{#BASE.HandleEvent}(): Subscribe to a DCS Event.
|
||||
-- * @{#BASE.UnHandleEvent}(): Unsubscribe from a DCS Event.
|
||||
@ -114,10 +147,12 @@
|
||||
--
|
||||
-- ## 1.5) All objects derived from BASE can have "States"
|
||||
--
|
||||
-- A mechanism is in place in MOOSE, that allows to let the objects administer **states**.
|
||||
-- States are essentially properties of objects, which are identified by a **Key** and a **Value**.
|
||||
-- The method @{#BASE.SetState}() can be used to set a Value with a reference Key to the object.
|
||||
-- To **read or retrieve** a state Value based on a Key, use the @{#BASE.GetState} method.
|
||||
-- A mechanism is in place in MOOSE, that allows to let the objects administer **states**.
|
||||
-- States are essentially properties of objects, which are identified by a **Key** and a **Value**.
|
||||
--
|
||||
-- The method @{#BASE.SetState}() can be used to set a Value with a reference Key to the object.
|
||||
-- To **read or retrieve** a state Value based on a Key, use the @{#BASE.GetState} method.
|
||||
--
|
||||
-- These two methods provide a very handy way to keep state at long lasting processes.
|
||||
-- Values can be stored within the objects, and later retrieved or changed when needed.
|
||||
-- There is one other important thing to note, the @{#BASE.SetState}() and @{#BASE.GetState} methods
|
||||
@ -125,9 +160,9 @@
|
||||
-- Thus, if the state is to be set for the same object as the object for which the method is used, then provide the same
|
||||
-- object name to the method.
|
||||
--
|
||||
-- ## 1.10) BASE Inheritance (tree) support
|
||||
-- ## 1.10) Inheritance
|
||||
--
|
||||
-- The following methods are available to support inheritance:
|
||||
-- The following methods are available to implement inheritance
|
||||
--
|
||||
-- * @{#BASE.Inherit}: Inherits from a class.
|
||||
-- * @{#BASE.GetParent}: Returns the parent object from the object it is handling, or nil if there is no parent object.
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
--- This core module models the dispatching of DCS Events to subscribed MOOSE classes,
|
||||
-- following a given priority.
|
||||
--- **Core** - EVENT models DCS **event dispatching** using a **publish-subscribe** model.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
--- This module contains the **FSM** (**F**inite **S**tate **M**achine) class and derived **FSM\_** classes.
|
||||
-- ## Finite State Machines (FSM) are design patterns allowing efficient (long-lasting) processes and workflows.
|
||||
--- **Core** - The **FSM** (**F**inite **S**tate **M**achine) class and derived **FSM\_** classes
|
||||
-- are design patterns allowing efficient (long-lasting) processes and workflows.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- This module contains the MENU classes.
|
||||
--- **Core** -- MENU_ classes model the definition of **hierarchical menu structures** and **commands for players** within a mission.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
|
||||
@ -1,26 +1,40 @@
|
||||
--- This module contains the MESSAGE class.
|
||||
--- **Core** - MESSAGE class takes are of the **real-time notifications** and **messages to players** during a simulation.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{Message#MESSAGE} class, extends @{Base#BASE}
|
||||
--
|
||||
-- 1) @{Message#MESSAGE} class, extends @{Base#BASE}
|
||||
-- =================================================
|
||||
-- Message System to display Messages to Clients, Coalitions or All.
|
||||
-- Messages are shown on the display panel for an amount of seconds, and will then disappear.
|
||||
-- Messages can contain a category which is indicating the category of the message.
|
||||
--
|
||||
-- 1.1) MESSAGE construction methods
|
||||
-- ---------------------------------
|
||||
-- ## 1.1) MESSAGE construction
|
||||
--
|
||||
-- Messages are created with @{Message#MESSAGE.New}. Note that when the MESSAGE object is created, no message is sent yet.
|
||||
-- To send messages, you need to use the To functions.
|
||||
--
|
||||
-- 1.2) Send messages with MESSAGE To methods
|
||||
-- ------------------------------------------
|
||||
-- Messages are sent to:
|
||||
-- ## 1.2) Send messages to an audience
|
||||
--
|
||||
-- Messages are sent:
|
||||
--
|
||||
-- * Clients with @{Message#MESSAGE.ToClient}.
|
||||
-- * Coalitions with @{Message#MESSAGE.ToCoalition}.
|
||||
-- * All Players with @{Message#MESSAGE.ToAll}.
|
||||
-- * To a @{Client} using @{Message#MESSAGE.ToClient}().
|
||||
-- * To a @{Group} using @{Message#MESSAGE.ToGroup}()
|
||||
-- * To a coalition using @{Message#MESSAGE.ToCoalition}().
|
||||
-- * To the red coalition using @{Message#MESSAGE.ToRed}().
|
||||
-- * To the blue coalition using @{Message#MESSAGE.ToBlue}().
|
||||
-- * To all Players using @{Message#MESSAGE.ToAll}().
|
||||
--
|
||||
-- ## 1.3) Send conditionally to an audience
|
||||
--
|
||||
-- Messages can be sent conditionally to an audience (when a condition is true):
|
||||
--
|
||||
-- * To all players using @{Message#MESSAGE.ToAllIf}().
|
||||
-- * To a coalition using @{Message#MESSAGE.ToCoalitionIf}().
|
||||
--
|
||||
--
|
||||
-- @module Message
|
||||
-- @author FlightControl
|
||||
|
||||
--- The MESSAGE class
|
||||
-- @type MESSAGE
|
||||
@ -229,80 +243,3 @@ function MESSAGE:ToAllIf( Condition )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
----- The MESSAGEQUEUE class
|
||||
---- @type MESSAGEQUEUE
|
||||
--MESSAGEQUEUE = {
|
||||
-- ClientGroups = {},
|
||||
-- CoalitionSides = {}
|
||||
--}
|
||||
--
|
||||
--function MESSAGEQUEUE:New( RefreshInterval )
|
||||
-- local self = BASE:Inherit( self, BASE:New() )
|
||||
-- self:F( { RefreshInterval } )
|
||||
--
|
||||
-- self.RefreshInterval = RefreshInterval
|
||||
--
|
||||
-- --self.DisplayFunction = routines.scheduleFunction( self._DisplayMessages, { self }, 0, RefreshInterval )
|
||||
-- self.DisplayFunction = SCHEDULER:New( self, self._DisplayMessages, {}, 0, RefreshInterval )
|
||||
--
|
||||
-- return self
|
||||
--end
|
||||
--
|
||||
----- This function is called automatically by the MESSAGEQUEUE scheduler.
|
||||
--function MESSAGEQUEUE:_DisplayMessages()
|
||||
--
|
||||
-- -- First we display all messages that a coalition needs to receive... Also those who are not in a client (CA module clients...).
|
||||
-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do
|
||||
-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do
|
||||
-- if MessageData.MessageSent == false then
|
||||
-- --trigger.action.outTextForCoalition( CoalitionSideID, MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration )
|
||||
-- MessageData.MessageSent = true
|
||||
-- end
|
||||
-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime()
|
||||
-- if MessageTimeLeft <= 0 then
|
||||
-- MessageData = nil
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- Then we send the messages for each individual client, but also to be included are those Coalition messages for the Clients who belong to a coalition.
|
||||
-- -- Because the Client messages will overwrite the Coalition messages (for that Client).
|
||||
-- for ClientGroupName, ClientGroupData in pairs( self.ClientGroups ) do
|
||||
-- for MessageID, MessageData in pairs( ClientGroupData.Messages ) do
|
||||
-- if MessageData.MessageGroup == false then
|
||||
-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration )
|
||||
-- MessageData.MessageGroup = true
|
||||
-- end
|
||||
-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime()
|
||||
-- if MessageTimeLeft <= 0 then
|
||||
-- MessageData = nil
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- Now check if the Client also has messages that belong to the Coalition of the Client...
|
||||
-- for CoalitionSideID, CoalitionSideData in pairs( self.CoalitionSides ) do
|
||||
-- for MessageID, MessageData in pairs( CoalitionSideData.Messages ) do
|
||||
-- local CoalitionGroup = Group.getByName( ClientGroupName )
|
||||
-- if CoalitionGroup and CoalitionGroup:getCoalition() == CoalitionSideID then
|
||||
-- if MessageData.MessageCoalition == false then
|
||||
-- trigger.action.outTextForGroup( Group.getByName(ClientGroupName):getID(), MessageData.MessageCategory .. '\n' .. MessageData.MessageText:gsub("\n$",""):gsub("\n$",""), MessageData.MessageDuration )
|
||||
-- MessageData.MessageCoalition = true
|
||||
-- end
|
||||
-- end
|
||||
-- local MessageTimeLeft = ( MessageData.MessageTime + MessageData.MessageDuration ) - timer.getTime()
|
||||
-- if MessageTimeLeft <= 0 then
|
||||
-- MessageData = nil
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- return true
|
||||
--end
|
||||
--
|
||||
----- The _MessageQueue object is created when the MESSAGE class module is loaded.
|
||||
----_MessageQueue = MESSAGEQUEUE:New( 0.5 )
|
||||
--
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- This module contains the POINT classes.
|
||||
--- **Core** - **POINT\_VEC** classes define an **extensive API** to **manage 3D points** in the simulation space.
|
||||
--
|
||||
-- 1) @{Point#POINT_VEC3} class, extends @{Base#BASE}
|
||||
-- ==================================================
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- This module contains the SET classes.
|
||||
--- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
--- This core module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
|
||||
--- **Core** - ZONE classes define **zones** within your mission of **various forms**, with **various capabilities**.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- There are essentially two core functions that zones accomodate:
|
||||
--
|
||||
|
||||
BIN
Moose Presentations/BASE.pptx
Normal file
BIN
Moose Presentations/BASE.pptx
Normal file
Binary file not shown.
BIN
Moose Presentations/MESSAGE.pptx
Normal file
BIN
Moose Presentations/MESSAGE.pptx
Normal file
Binary file not shown.
@ -72,40 +72,78 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Base</code></h1>
|
||||
|
||||
<p>This module contains the BASE class.</p>
|
||||
<p><strong>Core</strong> - BASE forms <strong>the basis of the MOOSE framework</strong>.</p>
|
||||
|
||||
|
||||
<p>Each class within the MOOSE framework derives from BASE.</p>
|
||||
|
||||
<p><img src="..\Presentations\BASE\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="##(BASE)">#BASE</a> class</h1>
|
||||
<p>The <a href="##(BASE)">#BASE</a> class is the super class for all the classes defined within MOOSE.</p>
|
||||
|
||||
<p>It handles:</p>
|
||||
<p>All classes within the MOOSE framework are derived from the <a href="##(BASE)">#BASE</a> class. </p>
|
||||
|
||||
<p>BASE provides facilities for :</p>
|
||||
|
||||
<ul>
|
||||
<li>The construction and inheritance of child classes.</li>
|
||||
<li>The tracing of objects during mission execution within the <strong>DCS.log</strong> file, under the <strong>"Saved Games\DCS\Logs"</strong> folder.</li>
|
||||
<li>The construction and inheritance of MOOSE classes.</li>
|
||||
<li>The class naming and numbering system.</li>
|
||||
<li>The class hierarchy search system.</li>
|
||||
<li>The tracing of information or objects during mission execution for debuggin purposes.</li>
|
||||
<li>The subscription to DCS events for event handling in MOOSE objects.</li>
|
||||
</ul>
|
||||
|
||||
<p>Note: Normally you would not use the BASE class unless you are extending the MOOSE framework with new classes.</p>
|
||||
<p>Note: The BASE class is an abstract class and is not meant to be used directly.</p>
|
||||
|
||||
<h2>1.1) BASE constructor</h2>
|
||||
|
||||
<p>Any class derived from BASE, must use the <a href="Base.html##(BASE).New">Base#BASE.New</a> method how this is done.</p>
|
||||
|
||||
<h2>1.2) BASE Trace functionality</h2>
|
||||
<h2>1.2) Trace information for debugging</h2>
|
||||
|
||||
<p>The BASE class contains trace methods to trace progress within a mission execution of a certain object.
|
||||
Note that these trace methods are inherited by each MOOSE class interiting BASE.
|
||||
As such, each object created from derived class from BASE can use the tracing functions to trace its execution.</p>
|
||||
These trace methods are inherited by each MOOSE class interiting BASE, soeach object created from derived class from BASE can use the tracing methods to trace its execution.</p>
|
||||
|
||||
<h3>1.2.1) Tracing functions</h3>
|
||||
<p>Any type of information can be passed to these tracing methods. See the following examples:</p>
|
||||
|
||||
<p>There are basically 3 types of tracing methods available within BASE:</p>
|
||||
<pre><code>self:E( "Hello" )
|
||||
</code></pre>
|
||||
|
||||
<p>Result in the word "Hello" in the dcs.log.</p>
|
||||
|
||||
<pre><code>local Array = { 1, nil, "h", { "a","b" }, "x" }
|
||||
self:E( Array )
|
||||
</code></pre>
|
||||
|
||||
<p>Results with the text [1]=1,[3]="h",[4]={[1]="a",[2]="b"},[5]="x"} in the dcs.log. </p>
|
||||
|
||||
<pre><code>local Object1 = "Object1"
|
||||
local Object2 = 3
|
||||
local Object3 = { Object 1, Object 2 }
|
||||
self:E( { Object1, Object2, Object3 } )
|
||||
</code></pre>
|
||||
|
||||
<p>Results with the text [1]={[1]="Object",[2]=3,[3]={[1]="Object",[2]=3}} in the dcs.log.</p>
|
||||
|
||||
<pre><code>local SpawnObject = SPAWN:New( "Plane" )
|
||||
local GroupObject = GROUP:FindByName( "Group" )
|
||||
self:E( { Spawn = SpawnObject, Group = GroupObject } )
|
||||
</code></pre>
|
||||
|
||||
<p>Results with the text [1]={Spawn={....),Group={...}} in the dcs.log. </p>
|
||||
|
||||
<p>Below a more detailed explanation of the different method types for tracing.</p>
|
||||
|
||||
<h3>1.2.1) Tracing methods categories</h3>
|
||||
|
||||
<p>There are basically 3 types of tracing methods available:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(BASE).F">BASE.F</a>: Trace the beginning of a function and its given parameters. An F is indicated at column 44 in the DCS.log file.</li>
|
||||
<li><a href="##(BASE).T">BASE.T</a>: Trace further logic within a function giving optional variables or parameters. A T is indicated at column 44 in the DCS.log file.</li>
|
||||
<li><a href="##(BASE).E">BASE.E</a>: Trace an exception within a function giving optional variables or parameters. An E is indicated at column 44 in the DCS.log file. An exception will always be traced.</li>
|
||||
<li><a href="##(BASE).F">BASE.F</a>: Used to trace the entrance of a function and its given parameters. An F is indicated at column 44 in the DCS.log file.</li>
|
||||
<li><a href="##(BASE).T">BASE.T</a>: Used to trace further logic within a function giving optional variables or parameters. A T is indicated at column 44 in the DCS.log file.</li>
|
||||
<li><a href="##(BASE).E">BASE.E</a>: Used to always trace information giving optional variables or parameters. An E is indicated at column 44 in the DCS.log file.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.2.2) Tracing levels</h3>
|
||||
@ -131,10 +169,11 @@ These tracing levels were defined to avoid bulks of tracing to be generated by l
|
||||
<li>Activate all tracing through the <a href="##(BASE).TraceAll">BASE.TraceAll</a>() method.</li>
|
||||
<li>Activate only the tracing of a certain class (name) through the <a href="##(BASE).TraceClass">BASE.TraceClass</a>() method.</li>
|
||||
<li>Activate only the tracing of a certain method of a certain class through the <a href="##(BASE).TraceClassMethod">BASE.TraceClassMethod</a>() method.</li>
|
||||
<li>Activate only the tracing of a certain level through the <a href="##(BASE).TraceLevel">BASE.TraceLevel</a>() method.
|
||||
<h3>1.2.4) Check if tracing is on.</h3></li>
|
||||
<li>Activate only the tracing of a certain level through the <a href="##(BASE).TraceLevel">BASE.TraceLevel</a>() method.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.2.4) Check if tracing is on.</h3>
|
||||
|
||||
<p>The method <a href="##(BASE).IsTrace">BASE.IsTrace</a>() will validate if tracing is activated or not.</p>
|
||||
|
||||
<h2>1.3 DCS simulator Event Handling</h2>
|
||||
@ -146,7 +185,7 @@ and handled through lua scripting. MOOSE provides an encapsulation to handle the
|
||||
|
||||
<p>At first, the mission designer will need to <strong>Subscribe</strong> to a specific DCS event for the class.
|
||||
So, when the DCS event occurs, the class will be notified of that event.
|
||||
There are two functions which you use to subscribe to or unsubscribe from an event.</p>
|
||||
There are two methods which you use to subscribe to or unsubscribe from an event.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(BASE).HandleEvent">BASE.HandleEvent</a>(): Subscribe to a DCS Event.</li>
|
||||
@ -201,20 +240,22 @@ about the event that occurred.</p>
|
||||
|
||||
<h2>1.5) All objects derived from BASE can have "States"</h2>
|
||||
|
||||
<p>A mechanism is in place in MOOSE, that allows to let the objects administer <strong>states</strong>.
|
||||
States are essentially properties of objects, which are identified by a <strong>Key</strong> and a <strong>Value</strong>.
|
||||
The method <a href="##(BASE).SetState">BASE.SetState</a>() can be used to set a Value with a reference Key to the object.
|
||||
To <strong>read or retrieve</strong> a state Value based on a Key, use the <a href="##(BASE).GetState">BASE.GetState</a> method.
|
||||
These two methods provide a very handy way to keep state at long lasting processes.
|
||||
<p>A mechanism is in place in MOOSE, that allows to let the objects administer <strong>states</strong>. <br/>
|
||||
States are essentially properties of objects, which are identified by a <strong>Key</strong> and a <strong>Value</strong>. </p>
|
||||
|
||||
<p>The method <a href="##(BASE).SetState">BASE.SetState</a>() can be used to set a Value with a reference Key to the object. <br/>
|
||||
To <strong>read or retrieve</strong> a state Value based on a Key, use the <a href="##(BASE).GetState">BASE.GetState</a> method. </p>
|
||||
|
||||
<p>These two methods provide a very handy way to keep state at long lasting processes.
|
||||
Values can be stored within the objects, and later retrieved or changed when needed.
|
||||
There is one other important thing to note, the <a href="##(BASE).SetState">BASE.SetState</a>() and <a href="##(BASE).GetState">BASE.GetState</a> methods
|
||||
receive as the <strong>first parameter the object for which the state needs to be set</strong>.
|
||||
Thus, if the state is to be set for the same object as the object for which the method is used, then provide the same
|
||||
object name to the method.</p>
|
||||
|
||||
<h2>1.10) BASE Inheritance (tree) support</h2>
|
||||
<h2>1.10) Inheritance</h2>
|
||||
|
||||
<p>The following methods are available to support inheritance:</p>
|
||||
<p>The following methods are available to implement inheritance</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(BASE).Inherit">BASE.Inherit</a>: Inherits from a class.</li>
|
||||
|
||||
@ -2425,6 +2425,7 @@ The UNIT carrying the package.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
|
||||
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
|
||||
</a>
|
||||
|
||||
@ -108,7 +108,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
|
||||
<p>Find below a list of the <strong>assigned task</strong> methods:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(CONTROLLABLE).TaskAttackControllable">CONTROLLABLE.TaskAttackControllable</a>: (AIR) Attack a Controllable.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskAttackGroup">CONTROLLABLE.TaskAttackGroup</a>: (AIR) Attack a Controllable.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskAttackMapObject">CONTROLLABLE.TaskAttackMapObject</a>: (AIR) Attacking the map object (building, structure, e.t.c).</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskAttackUnit">CONTROLLABLE.TaskAttackUnit</a>: (AIR) Attack the Unit.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskBombing">CONTROLLABLE.TaskBombing</a>: (AIR) Delivering weapon at the point on the ground.</li>
|
||||
@ -116,7 +116,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
|
||||
<li><a href="##(CONTROLLABLE).TaskEmbarking">CONTROLLABLE.TaskEmbarking</a>: (AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskEmbarkToTransport">CONTROLLABLE.TaskEmbarkToTransport</a>: (GROUND) Embark to a Transport landed at a location.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskEscort">CONTROLLABLE.TaskEscort</a>: (AIR) Escort another airborne controllable. </li>
|
||||
<li><a href="##(CONTROLLABLE).TaskFAC_AttackControllable">CONTROLLABLE.TaskFAC_AttackControllable</a>: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskFAC_AttackGroup">CONTROLLABLE.TaskFAC_AttackGroup</a>: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskFireAtPoint">CONTROLLABLE.TaskFireAtPoint</a>: (GROUND) Fire some or all ammunition at a VEC2 point.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskFollow">CONTROLLABLE.TaskFollow</a>: (AIR) Following another airborne controllable.</li>
|
||||
<li><a href="##(CONTROLLABLE).TaskHold">CONTROLLABLE.TaskHold</a>: (GROUND) Hold ground controllable from moving.</li>
|
||||
@ -1011,7 +1011,7 @@ All en-route tasks have the priority parameter. This is a number (less value - h
|
||||
<li>
|
||||
|
||||
<p><code><em>#boolean AttackQtyLimit </em></code>:
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackGroup" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
@ -2038,7 +2038,7 @@ The Controllable to be attacked.</p>
|
||||
<li>
|
||||
|
||||
<p><code><em>#boolean AttackQtyLimit </em></code>:
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackGroup" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
@ -2152,7 +2152,7 @@ The unit.</p>
|
||||
<li>
|
||||
|
||||
<p><code><em>#boolean AttackQtyLimit </em></code>:
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackGroup" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
@ -2203,7 +2203,7 @@ The DCS task structure.</p>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number AttackQty </em></code>:
|
||||
(optional) Desired quantity of passes. The parameter is not the same in AttackControllable and AttackUnit tasks. </p>
|
||||
(optional) Desired quantity of passes. The parameter is not the same in AttackGroup and AttackUnit tasks. </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@ -72,8 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Event</code></h1>
|
||||
|
||||
<p>This core module models the dispatching of DCS Events to subscribed MOOSE classes,
|
||||
following a given priority.</p>
|
||||
<p><strong>Core</strong> - EVENT models DCS <strong>event dispatching</strong> using a <strong>publish-subscribe</strong> model.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -72,10 +72,10 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Fsm</code></h1>
|
||||
|
||||
<p>This module contains the <strong>FSM</strong> (<strong>F</strong>inite <strong>S</strong>tate <strong>M</strong>achine) class and derived <strong>FSM_</strong> classes.</p>
|
||||
<p><strong>Core</strong> - The <strong>FSM</strong> (<strong>F</strong>inite <strong>S</strong>tate <strong>M</strong>achine) class and derived <strong>FSM_</strong> classes
|
||||
are design patterns allowing efficient (long-lasting) processes and workflows.</p>
|
||||
|
||||
|
||||
<h2>Finite State Machines (FSM) are design patterns allowing efficient (long-lasting) processes and workflows.</h2>
|
||||
|
||||
<p><img src="..\Presentations\FSM\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Menu</code></h1>
|
||||
|
||||
<p>This module contains the MENU classes.</p>
|
||||
<p><strong>Core</strong> -- MENU_ classes model the definition of <strong>hierarchical menu structures</strong> and <strong>commands for players</strong> within a mission.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -72,29 +72,49 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Message</code></h1>
|
||||
|
||||
<p>This module contains the MESSAGE class.</p>
|
||||
<p><strong>Core</strong> - MESSAGE class takes are of the <strong>real-time notifications</strong> and <strong>messages to players</strong> during a simulation.</p>
|
||||
|
||||
|
||||
|
||||
<p><img src="..\Presentations\MESSAGE\Dia1.JPG" alt="Banner Image"/></p>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="Message.html##(MESSAGE)">Message#MESSAGE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
|
||||
<p>Message System to display Messages to Clients, Coalitions or All.
|
||||
Messages are shown on the display panel for an amount of seconds, and will then disappear.
|
||||
Messages can contain a category which is indicating the category of the message.</p>
|
||||
|
||||
<h2>1.1) MESSAGE construction methods</h2>
|
||||
<h2>1.1) MESSAGE construction</h2>
|
||||
|
||||
<p>Messages are created with <a href="Message.html##(MESSAGE).New">Message#MESSAGE.New</a>. Note that when the MESSAGE object is created, no message is sent yet.
|
||||
To send messages, you need to use the To functions.</p>
|
||||
|
||||
<h2>1.2) Send messages with MESSAGE To methods</h2>
|
||||
<p>Messages are sent to:</p>
|
||||
<h2>1.2) Send messages to an audience</h2>
|
||||
|
||||
<p>Messages are sent:</p>
|
||||
|
||||
<ul>
|
||||
<li>Clients with <a href="Message.html##(MESSAGE).ToClient">Message#MESSAGE.ToClient</a>.</li>
|
||||
<li>Coalitions with <a href="Message.html##(MESSAGE).ToCoalition">Message#MESSAGE.ToCoalition</a>.</li>
|
||||
<li>All Players with <a href="Message.html##(MESSAGE).ToAll">Message#MESSAGE.ToAll</a>.
|
||||
</li>
|
||||
<li>To a <a href="Client.html">Client</a> using <a href="Message.html##(MESSAGE).ToClient">Message#MESSAGE.ToClient</a>().</li>
|
||||
<li>To a <a href="Group.html">Group</a> using <a href="Message.html##(MESSAGE).ToGroup">Message#MESSAGE.ToGroup</a>()</li>
|
||||
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalition">Message#MESSAGE.ToCoalition</a>().</li>
|
||||
<li>To the red coalition using <a href="Message.html##(MESSAGE).ToRed">Message#MESSAGE.ToRed</a>().</li>
|
||||
<li>To the blue coalition using <a href="Message.html##(MESSAGE).ToBlue">Message#MESSAGE.ToBlue</a>().</li>
|
||||
<li>To all Players using <a href="Message.html##(MESSAGE).ToAll">Message#MESSAGE.ToAll</a>().</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.3) Send conditionally to an audience</h2>
|
||||
|
||||
<p>Messages can be sent conditionally to an audience (when a condition is true):</p>
|
||||
|
||||
<ul>
|
||||
<li>To all players using <a href="Message.html##(MESSAGE).ToAllIf">Message#MESSAGE.ToAllIf</a>().</li>
|
||||
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalitionIf">Message#MESSAGE.ToCoalitionIf</a>().</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Point</code></h1>
|
||||
|
||||
<p>This module contains the POINT classes.</p>
|
||||
<p><strong>Core</strong> - <strong>POINT_VEC</strong> classes define an <strong>extensive API</strong> to <strong>manage 3D points</strong> in the simulation space.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -550,7 +550,7 @@ Various methods exist to configure:</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SCORING).ScoreCSV">SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SCORING).ScoreCSV">SCORING:ScoreCSV(PlayerName, TargetPlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)</a></td>
|
||||
<td class="summary">
|
||||
<p>Registers a score for a player.</p>
|
||||
</td>
|
||||
@ -1637,7 +1637,7 @@ The player group.</p>
|
||||
<dt>
|
||||
|
||||
<a id="#(SCORING).ScoreCSV" >
|
||||
<strong>SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)</strong>
|
||||
<strong>SCORING:ScoreCSV(PlayerName, TargetPlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -1654,6 +1654,12 @@ The name of the player.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string TargetPlayerName </em></code>:
|
||||
The name of the target player.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string ScoreType </em></code>:
|
||||
The type of the score.</p>
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Set</code></h1>
|
||||
|
||||
<p>This module contains the SET classes.</p>
|
||||
<p><strong>Core</strong> - SET classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1759,9 +1759,6 @@ The group that was spawned. You can use this group for further actions.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -72,10 +72,12 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Zone</code></h1>
|
||||
|
||||
<p>This core module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
|
||||
<p><strong>Core</strong> - ZONE classes define <strong>zones</strong> within your mission of <strong>various forms</strong>, with <strong>various capabilities</strong>.</p>
|
||||
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<p>There are essentially two core functions that zones accomodate:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
@ -161,7 +161,7 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Base.html">Base</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the BASE class.</p>
|
||||
<p><strong>Core</strong> - BASE forms <strong>the basis of the MOOSE framework</strong>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -232,14 +232,14 @@ and automatically engage any airborne enemies that are within a certain range or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Event.html">Event</a></td>
|
||||
<td class="summary">
|
||||
<p>This core module models the dispatching of DCS Events to subscribed MOOSE classes,
|
||||
following a given priority.</p>
|
||||
<p><strong>Core</strong> - EVENT models DCS <strong>event dispatching</strong> using a <strong>publish-subscribe</strong> model.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Fsm.html">Fsm</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the <strong>FSM</strong> (<strong>F</strong>inite <strong>S</strong>tate <strong>M</strong>achine) class and derived <strong>FSM_</strong> classes.</p>
|
||||
<p><strong>Core</strong> - The <strong>FSM</strong> (<strong>F</strong>inite <strong>S</strong>tate <strong>M</strong>achine) class and derived <strong>FSM_</strong> classes
|
||||
are design patterns allowing efficient (long-lasting) processes and workflows.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -263,13 +263,13 @@ following a given priority.</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Menu.html">Menu</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the MENU classes.</p>
|
||||
<p><strong>Core</strong> -- MENU_ classes model the definition of <strong>hierarchical menu structures</strong> and <strong>commands for players</strong> within a mission.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Message.html">Message</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the MESSAGE class.</p>
|
||||
<p><strong>Core</strong> - MESSAGE class takes are of the <strong>real-time notifications</strong> and <strong>messages to players</strong> during a simulation.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -293,7 +293,7 @@ following a given priority.</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Point.html">Point</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the POINT classes.</p>
|
||||
<p><strong>Core</strong> - <strong>POINT_VEC</strong> classes define an <strong>extensive API</strong> to <strong>manage 3D points</strong> in the simulation space.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -363,7 +363,7 @@ and creates a CSV file logging the scoring events and results for use at team or
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Set.html">Set</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the SET classes.</p>
|
||||
<p><strong>Core</strong> - SET classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -433,7 +433,7 @@ which are excellent tools to be reused in an OO environment!.</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Zone.html">Zone</a></td>
|
||||
<td class="summary">
|
||||
<p>This core module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
|
||||
<p><strong>Core</strong> - ZONE classes define <strong>zones</strong> within your mission of <strong>various forms</strong>, with <strong>various capabilities</strong>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
BIN
docs/Presentations/BASE/Dia1.JPG
Normal file
BIN
docs/Presentations/BASE/Dia1.JPG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
BIN
docs/Presentations/MESSAGE/Dia1.JPG
Normal file
BIN
docs/Presentations/MESSAGE/Dia1.JPG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
Loading…
x
Reference in New Issue
Block a user