mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Various Fixes
-- Documentation fixes with links not working. -- MENU_CLIENT_COMMAND had a small glitch, fixed that one too. -- Implemented new Event Dispatcher. --
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
--
|
||||
-- ## 1.1) BASE constructor
|
||||
--
|
||||
-- Any class derived from BASE, must use the @{Core.Base#BASE.New) constructor within the @{Core.Base#BASE.Inherit) method.
|
||||
-- See an example at the @{Core.Base#BASE.New} method how this is done.
|
||||
-- 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
|
||||
--
|
||||
@@ -84,8 +84,8 @@
|
||||
-- * @{#BASE.EventOnTakeOff}(): Handle the event when a unit takes off from a runway.
|
||||
-- * @{#BASE.EventOnTookControl}(): Handle the event when a player takes control of a unit.
|
||||
--
|
||||
-- The EventOn() methods provide the @{Core.Event#EVENTDATA} structure to the event handling function.
|
||||
-- The @{Core.Event#EVENTDATA} structure contains an enriched data set of information about the event being handled.
|
||||
-- The EventOn() methods provide the @{Event#EVENTDATA} structure to the event handling function.
|
||||
-- The @{Event#EVENTDATA} structure contains an enriched data set of information about the event being handled.
|
||||
--
|
||||
-- Find below an example of the prototype how to write an event handling function:
|
||||
--
|
||||
@@ -105,7 +105,7 @@
|
||||
-- Note the function( self, EventData ). It takes two parameters:
|
||||
--
|
||||
-- * self = the object that is handling the EventOnPlayerEnterUnit.
|
||||
-- * EventData = the @{Core.Event#EVENTDATA} structure, containing more information of the Event.
|
||||
-- * EventData = the @{Event#EVENTDATA} structure, containing more information of the Event.
|
||||
--
|
||||
-- ## 1.4) Class identification methods
|
||||
--
|
||||
@@ -288,20 +288,20 @@ function BASE:GetClassID()
|
||||
return self.ClassID
|
||||
end
|
||||
|
||||
--- Get the Class @{Core.Event} processing Priority.
|
||||
--- Get the Class @{Event} processing Priority.
|
||||
-- The Event processing Priority is a number from 1 to 10,
|
||||
-- reflecting the order of the classes subscribed to the Event to be processed.
|
||||
-- @param #BASE self
|
||||
-- @return #number The @{Core.Event} processing Priority.
|
||||
-- @return #number The @{Event} processing Priority.
|
||||
function BASE:GetEventPriority()
|
||||
return self._Private.EventPriority or 5
|
||||
end
|
||||
|
||||
--- Set the Class @{Core.Event} processing Priority.
|
||||
--- Set the Class @{Event} processing Priority.
|
||||
-- The Event processing Priority is a number from 1 to 10,
|
||||
-- reflecting the order of the classes subscribed to the Event to be processed.
|
||||
-- @param #BASE self
|
||||
-- @param #number EventPriority The @{Core.Event} processing Priority.
|
||||
-- @param #number EventPriority The @{Event} processing Priority.
|
||||
-- @return self
|
||||
function BASE:SetEventPriority( EventPriority )
|
||||
self._Private.EventPriority = EventPriority
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 1) @{Core.Database#DATABASE} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{#DATABASE} class, extends @{Base#BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the DATABASE class to refer to:
|
||||
--
|
||||
|
||||
@@ -157,7 +157,7 @@ function EVENT:Remove( EventClass, EventID )
|
||||
self.Events[EventID][EventPriority][EventClass] = nil
|
||||
end
|
||||
|
||||
--- Clears all event subscriptions for a @{Core.Base#BASE} derived object.
|
||||
--- Clears all event subscriptions for a @{Base#BASE} derived object.
|
||||
-- @param #EVENT self
|
||||
-- @param Core.Base#BASE EventObject
|
||||
function EVENT:RemoveAll( EventObject )
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- A FSM can only be in one of a finite number of states.
|
||||
-- The machine is in only one state at a time; the state it is in at any given time is called the **current state**.
|
||||
-- It can change from one state to another when initiated by an **__internal__ or __external__ triggering event**, which is called a **transition**.
|
||||
@@ -46,7 +48,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{Core.Fsm#FSM} class, extends @{Core.Base#BASE}
|
||||
-- # 1) @{#FSM} class, extends @{Base#BASE}
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--- This module contains the MENU classes.
|
||||
--
|
||||
-- There is a small note... When you see a class like MENU_COMMAND_COALITION with COMMAND in italic, it acutally represents it like this: `MENU_COMMAND_COALITION`.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- DCS Menus can be managed using the MENU classes.
|
||||
@@ -15,17 +13,17 @@
|
||||
--
|
||||
-- ### To manage **main menus**, the classes begin with **MENU_**:
|
||||
--
|
||||
-- * @{Core.Menu#MENU_MISSION}: Manages main menus for whole mission file.
|
||||
-- * @{Core.Menu#MENU_COALITION}: Manages main menus for whole coalition.
|
||||
-- * @{Core.Menu#MENU_GROUP}: Manages main menus for GROUPs.
|
||||
-- * @{Core.Menu#MENU_CLIENT}: Manages main menus for CLIENTs. This manages menus for units with the skill level "Client".
|
||||
-- * @{Menu#MENU_MISSION}: Manages main menus for whole mission file.
|
||||
-- * @{Menu#MENU_COALITION}: Manages main menus for whole coalition.
|
||||
-- * @{Menu#MENU_GROUP}: Manages main menus for GROUPs.
|
||||
-- * @{Menu#MENU_CLIENT}: Manages main menus for CLIENTs. This manages menus for units with the skill level "Client".
|
||||
--
|
||||
-- ### To manage **command menus**, which are menus that allow the player to issue **functions**, the classes begin with **MENU_COMMAND_**:
|
||||
--
|
||||
-- * @{Core.Menu#MENU_MISSION_COMMAND}: Manages command menus for whole mission file.
|
||||
-- * @{Core.Menu#MENU_COALITION_COMMAND}: Manages command menus for whole coalition.
|
||||
-- * @{Core.Menu#MENU_GROUP_COMMAND}: Manages command menus for GROUPs.
|
||||
-- * @{Core.Menu#MENU_CLIENT_COMMAND}: Manages command menus for CLIENTs. This manages menus for units with the skill level "Client".
|
||||
-- * @{Menu#MENU_MISSION_COMMAND}: Manages command menus for whole mission file.
|
||||
-- * @{Menu#MENU_COALITION_COMMAND}: Manages command menus for whole coalition.
|
||||
-- * @{Menu#MENU_GROUP_COMMAND}: Manages command menus for GROUPs.
|
||||
-- * @{Menu#MENU_CLIENT_COMMAND}: Manages command menus for CLIENTs. This manages menus for units with the skill level "Client".
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -37,11 +35,11 @@
|
||||
-- These are simply abstract base classes defining a couple of fields that are used by the
|
||||
-- derived MENU_ classes to manage menus.
|
||||
--
|
||||
-- 1.1) @{Core.Menu#MENU_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1.1) @{#MENU_BASE} class, extends @{Base#BASE}
|
||||
-- --------------------------------------------------
|
||||
-- The @{#MENU_BASE} class defines the main MENU class where other MENU classes are derived from.
|
||||
--
|
||||
-- 1.2) @{Core.Menu#MENU_COMMAND_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1.2) @{#MENU_COMMAND_BASE} class, extends @{Base#BASE}
|
||||
-- ----------------------------------------------------------
|
||||
-- The @{#MENU_COMMAND_BASE} class defines the main MENU class where other MENU COMMAND_ classes are derived from, in order to set commands.
|
||||
--
|
||||
@@ -53,15 +51,15 @@
|
||||
-- ======================
|
||||
-- The underlying classes manage the menus for a complete mission file.
|
||||
--
|
||||
-- 2.1) @{Menu#MENU_MISSION} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- 2.1) @{#MENU_MISSION} class, extends @{Menu#MENU_BASE}
|
||||
-- ---------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_MISSION} class manages the main menus for a complete mission.
|
||||
-- The @{Menu#MENU_MISSION} class manages the main menus for a complete mission.
|
||||
-- You can add menus with the @{#MENU_MISSION.New} method, which constructs a MENU_MISSION object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION.Remove}.
|
||||
--
|
||||
-- 2.2) @{Menu#MENU_MISSION_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- 2.2) @{#MENU_MISSION_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
|
||||
-- -------------------------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_MISSION_COMMAND} class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
|
||||
-- The @{Menu#MENU_MISSION_COMMAND} class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
|
||||
-- You can add menus with the @{#MENU_MISSION_COMMAND.New} method, which constructs a MENU_MISSION_COMMAND object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION_COMMAND.Remove}.
|
||||
--
|
||||
@@ -71,15 +69,15 @@
|
||||
-- =========================
|
||||
-- The underlying classes manage the menus for whole coalitions.
|
||||
--
|
||||
-- 3.1) @{Menu#MENU_COALITION} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- 3.1) @{#MENU_COALITION} class, extends @{Menu#MENU_BASE}
|
||||
-- ------------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_COALITION} class manages the main menus for coalitions.
|
||||
-- The @{Menu#MENU_COALITION} class manages the main menus for coalitions.
|
||||
-- You can add menus with the @{#MENU_COALITION.New} method, which constructs a MENU_COALITION object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION.Remove}.
|
||||
--
|
||||
-- 3.2) @{Menu#MENU_COALITION_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- 3.2) @{Menu#MENU_COALITION_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
|
||||
-- ----------------------------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_COALITION_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Menu#MENU_COALITION_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- You can add menus with the @{#MENU_COALITION_COMMAND.New} method, which constructs a MENU_COALITION_COMMAND object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION_COMMAND.Remove}.
|
||||
--
|
||||
@@ -89,15 +87,15 @@
|
||||
-- =====================
|
||||
-- The underlying classes manage the menus for groups. Note that groups can be inactive, alive or can be destroyed.
|
||||
--
|
||||
-- 4.1) @{Menu#MENU_GROUP} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- 4.1) @{Menu#MENU_GROUP} class, extends @{Menu#MENU_BASE}
|
||||
-- --------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_GROUP} class manages the main menus for coalitions.
|
||||
-- The @{Menu#MENU_GROUP} class manages the main menus for coalitions.
|
||||
-- You can add menus with the @{#MENU_GROUP.New} method, which constructs a MENU_GROUP object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP.Remove}.
|
||||
--
|
||||
-- 4.2) @{Menu#MENU_GROUP_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- 4.2) @{Menu#MENU_GROUP_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
|
||||
-- ------------------------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_GROUP_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Menu#MENU_GROUP_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- You can add menus with the @{#MENU_GROUP_COMMAND.New} method, which constructs a MENU_GROUP_COMMAND object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP_COMMAND.Remove}.
|
||||
--
|
||||
@@ -107,15 +105,15 @@
|
||||
-- ======================
|
||||
-- The underlying classes manage the menus for units with skill level client or player.
|
||||
--
|
||||
-- 5.1) @{Menu#MENU_CLIENT} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- 5.1) @{Menu#MENU_CLIENT} class, extends @{Menu#MENU_BASE}
|
||||
-- ---------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_CLIENT} class manages the main menus for coalitions.
|
||||
-- The @{Menu#MENU_CLIENT} class manages the main menus for coalitions.
|
||||
-- You can add menus with the @{#MENU_CLIENT.New} method, which constructs a MENU_CLIENT object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT.Remove}.
|
||||
--
|
||||
-- 5.2) @{Menu#MENU_CLIENT_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- 5.2) @{Menu#MENU_CLIENT_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
|
||||
-- -------------------------------------------------------------------------
|
||||
-- The @{Core.Menu#MENU_CLIENT_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Menu#MENU_CLIENT_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- You can add menus with the @{#MENU_CLIENT_COMMAND.New} method, which constructs a MENU_CLIENT_COMMAND object and returns you the object reference.
|
||||
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT_COMMAND.Remove}.
|
||||
--
|
||||
@@ -622,9 +620,8 @@ do -- MENU_CLIENT
|
||||
-- @param #string MenuText The text for the menu.
|
||||
-- @param #MENU_BASE ParentMenu The parent menu.
|
||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||
-- @param CommandMenuArgument An argument for the function.
|
||||
-- @return Menu#MENU_CLIENT_COMMAND self
|
||||
function MENU_CLIENT_COMMAND:New( MenuClient, MenuText, ParentMenu, CommandMenuFunction, ... )
|
||||
function MENU_CLIENT_COMMAND:New( Client, MenuText, ParentMenu, CommandMenuFunction, ... )
|
||||
|
||||
-- Arrange meta tables
|
||||
|
||||
@@ -635,8 +632,8 @@ do -- MENU_CLIENT
|
||||
|
||||
local self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, MenuParentPath, CommandMenuFunction, arg ) ) -- Menu#MENU_CLIENT_COMMAND
|
||||
|
||||
self.MenuClient = MenuClient
|
||||
self.MenuClientGroupID = MenuClient:GetClientGroupID()
|
||||
self.MenuClient = Client
|
||||
self.MenuClientGroupID = Client:GetClientGroupID()
|
||||
self.MenuParentPath = MenuParentPath
|
||||
self.MenuText = MenuText
|
||||
self.ParentMenu = ParentMenu
|
||||
@@ -647,7 +644,7 @@ do -- MENU_CLIENT
|
||||
|
||||
local MenuPath = _MENUCLIENTS[self.MenuClientGroupID]
|
||||
|
||||
self:T( { MenuClient:GetClientGroupName(), MenuPath[table.concat(MenuParentPath)], MenuParentPath, MenuText, CommandMenuFunction, arg } )
|
||||
self:T( { Client:GetClientGroupName(), MenuPath[table.concat(MenuParentPath)], MenuParentPath, MenuText, CommandMenuFunction, arg } )
|
||||
|
||||
local MenuPathID = table.concat(MenuParentPath) .. "/" .. MenuText
|
||||
if MenuPath[MenuPathID] then
|
||||
@@ -657,7 +654,9 @@ do -- MENU_CLIENT
|
||||
self.MenuPath = missionCommands.addCommandForGroup( self.MenuClient:GetClientGroupID(), MenuText, MenuParentPath, self.MenuCallHandler, arg )
|
||||
MenuPath[MenuPathID] = self.MenuPath
|
||||
|
||||
ParentMenu.Menus[self.MenuPath] = self
|
||||
if ParentMenu and ParentMenu.Menus then
|
||||
ParentMenu.Menus[self.MenuPath] = self
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- This module contains the MESSAGE class.
|
||||
--
|
||||
-- 1) @{Core.Message#MESSAGE} class, extends @{Core.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.
|
||||
@@ -8,16 +8,16 @@
|
||||
--
|
||||
-- 1.1) MESSAGE construction methods
|
||||
-- ---------------------------------
|
||||
-- Messages are created with @{Core.Message#MESSAGE.New}. Note that when the MESSAGE object is created, no message is sent yet.
|
||||
-- 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:
|
||||
--
|
||||
-- * Clients with @{Core.Message#MESSAGE.ToClient}.
|
||||
-- * Coalitions with @{Core.Message#MESSAGE.ToCoalition}.
|
||||
-- * All Players with @{Core.Message#MESSAGE.ToAll}.
|
||||
-- * Clients with @{Message#MESSAGE.ToClient}.
|
||||
-- * Coalitions with @{Message#MESSAGE.ToCoalition}.
|
||||
-- * All Players with @{Message#MESSAGE.ToAll}.
|
||||
--
|
||||
-- @module Message
|
||||
-- @author FlightControl
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- This module contains the POINT classes.
|
||||
--
|
||||
-- 1) @{Core.Point#POINT_VEC3} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{Point#POINT_VEC3} class, extends @{Base#BASE}
|
||||
-- ==================================================
|
||||
-- The @{Core.Point#POINT_VEC3} class defines a 3D point in the simulator.
|
||||
-- The @{Point#POINT_VEC3} class defines a 3D point in the simulator.
|
||||
--
|
||||
-- **Important Note:** Most of the functions in this section were taken from MIST, and reworked to OO concepts.
|
||||
-- In order to keep the credibility of the the author, I want to emphasize that the of the MIST framework was created by Grimes, who you can find on the Eagle Dynamics Forums.
|
||||
@@ -11,20 +11,20 @@
|
||||
-- ---------------------------
|
||||
-- A new POINT_VEC3 instance can be created with:
|
||||
--
|
||||
-- * @{#POINT_VEC3.New}(): a 3D point.
|
||||
-- * @{#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{Dcs.DCSTypes#Vec3}.
|
||||
-- * @{Point#POINT_VEC3.New}(): a 3D point.
|
||||
-- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
|
||||
--
|
||||
--
|
||||
-- 2) @{Core.Point#POINT_VEC2} class, extends @{Core.Point#POINT_VEC3}
|
||||
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
|
||||
-- =========================================================
|
||||
-- The @{Core.Point#POINT_VEC2} class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
|
||||
-- The @{Point#POINT_VEC2} class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
|
||||
--
|
||||
-- 2.1) POINT_VEC2 constructor
|
||||
-- ---------------------------
|
||||
-- A new POINT_VEC2 instance can be created with:
|
||||
--
|
||||
-- * @{#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
|
||||
-- * @{#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{Dcs.DCSTypes#Vec2}.
|
||||
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
|
||||
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -672,10 +672,10 @@ function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||
return Distance
|
||||
end
|
||||
|
||||
--- Calculate the distance from a reference @{Dcs.DCSTypes#Vec2}.
|
||||
--- Calculate the distance from a reference @{DCSTypes#Vec2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2Reference The reference @{Dcs.DCSTypes#Vec2}.
|
||||
-- @return Dcs.DCSTypes#Distance The distance from the reference @{Dcs.DCSTypes#Vec2} in meters.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2Reference The reference @{DCSTypes#Vec2}.
|
||||
-- @return Dcs.DCSTypes#Distance The distance from the reference @{DCSTypes#Vec2} in meters.
|
||||
function POINT_VEC2:DistanceFromVec2( Vec2Reference )
|
||||
self:F2( Vec2Reference )
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
--
|
||||
-- The SCHEDULEDISPATCHER allows multiple scheduled functions to be planned and executed for one SCHEDULER object.
|
||||
-- The SCHEDULER object therefore keeps a table of "CallID's", which are returned after each planning of a new scheduled function by the SCHEDULEDISPATCHER.
|
||||
-- The SCHEDULER object plans new scheduled functions through the @{Core.Scheduler#SCHEDULER.Schedule}() method.
|
||||
-- The SCHEDULER object plans new scheduled functions through the @{Scheduler#SCHEDULER.Schedule}() method.
|
||||
-- The Schedule() method returns the CallID that is the reference ID for each planned schedule.
|
||||
--
|
||||
-- ===
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
--- This module contains the SCHEDULER class.
|
||||
--
|
||||
-- # 1) @{Core.Scheduler#SCHEDULER} class, extends @{Core.Base#BASE}
|
||||
-- # 1) @{Scheduler#SCHEDULER} class, extends @{Base#BASE}
|
||||
--
|
||||
-- The @{Core.Scheduler#SCHEDULER} class creates schedule.
|
||||
-- The @{Scheduler#SCHEDULER} class creates schedule.
|
||||
--
|
||||
-- ## 1.1) SCHEDULER constructor
|
||||
--
|
||||
-- The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:
|
||||
--
|
||||
-- * @{Core.Scheduler#SCHEDULER.New}( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.
|
||||
-- * @{Core.Scheduler#SCHEDULER.New}( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.
|
||||
-- * @{Core.Scheduler#SCHEDULER.New}( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
|
||||
-- * @{Core.Scheduler#SCHEDULER.New}( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
|
||||
-- * @{Scheduler#SCHEDULER.New}( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.
|
||||
-- * @{Scheduler#SCHEDULER.New}( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.
|
||||
-- * @{Scheduler#SCHEDULER.New}( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
|
||||
-- * @{Scheduler#SCHEDULER.New}( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
|
||||
--
|
||||
-- ## 1.2) SCHEDULER timer stopping and (re-)starting.
|
||||
--
|
||||
-- The SCHEDULER can be stopped and restarted with the following methods:
|
||||
--
|
||||
-- * @{Core.Scheduler#SCHEDULER.Start}(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.
|
||||
-- * @{Core.Scheduler#SCHEDULER.Stop}(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.
|
||||
-- * @{Scheduler#SCHEDULER.Start}(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.
|
||||
-- * @{Scheduler#SCHEDULER.Stop}(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.
|
||||
--
|
||||
-- ## 1.3) Create a new schedule
|
||||
--
|
||||
-- With @{Core.Scheduler#SCHEDULER.Schedule}() a new time event can be scheduled. This function is used by the :New() constructor when a new schedule is planned.
|
||||
-- With @{Scheduler#SCHEDULER.Schedule}() a new time event can be scheduled. This function is used by the :New() constructor when a new schedule is planned.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Core.Set#SET_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
|
||||
-- ==============================================
|
||||
-- The @{Core.Set#SET_BASE} class defines the core functions that define a collection of objects.
|
||||
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
|
||||
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
|
||||
-- In this way, large loops can be done while not blocking the simulator main processing loop.
|
||||
-- The default **"yield interval"** is after 10 objects processed.
|
||||
@@ -12,18 +12,18 @@
|
||||
--
|
||||
-- 1.1) Add or remove objects from the SET
|
||||
-- ---------------------------------------
|
||||
-- Some key core functions are @{Core.Set#SET_BASE.Add} and @{Core.Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
|
||||
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
|
||||
--
|
||||
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Modify the iterator intervals with the @{Core.Set#SET_BASE.SetInteratorIntervals} method.
|
||||
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
|
||||
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Core.Set#SET_GROUP} class, extends @{Core.Set#SET_BASE}
|
||||
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
|
||||
-- ==================================================
|
||||
-- Mission designers can use the @{Core.Set#SET_GROUP} class to build sets of groups belonging to certain:
|
||||
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
-- * Categories
|
||||
@@ -38,7 +38,7 @@
|
||||
--
|
||||
-- 2.2) Add or Remove GROUP(s) from SET_GROUP:
|
||||
-- -------------------------------------------
|
||||
-- GROUPS can be added and removed using the @{Core.Set#SET_GROUP.AddGroupsByName} and @{Core.Set#SET_GROUP.RemoveGroupsByName} respectively.
|
||||
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
|
||||
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
|
||||
--
|
||||
-- 2.3) SET_GROUP filter criteria:
|
||||
@@ -57,7 +57,7 @@
|
||||
--
|
||||
-- Planned filter criteria within development are (so these are not yet available):
|
||||
--
|
||||
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Core.Zone#ZONE}.
|
||||
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
|
||||
--
|
||||
-- 2.4) SET_GROUP iterators:
|
||||
-- -------------------------
|
||||
@@ -72,9 +72,9 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 3) @{Core.Set#SET_UNIT} class, extends @{Core.Set#SET_BASE}
|
||||
-- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the @{Core.Set#SET_UNIT} class to build sets of units belonging to certain:
|
||||
-- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
-- * Categories
|
||||
@@ -90,7 +90,7 @@
|
||||
--
|
||||
-- 3.2) Add or Remove UNIT(s) from SET_UNIT:
|
||||
-- -----------------------------------------
|
||||
-- UNITs can be added and removed using the @{Core.Set#SET_UNIT.AddUnitsByName} and @{Core.Set#SET_UNIT.RemoveUnitsByName} respectively.
|
||||
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
|
||||
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
|
||||
--
|
||||
-- 3.3) SET_UNIT filter criteria:
|
||||
@@ -110,7 +110,7 @@
|
||||
--
|
||||
-- Planned filter criteria within development are (so these are not yet available):
|
||||
--
|
||||
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Core.Zone#ZONE}.
|
||||
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
|
||||
--
|
||||
-- 3.4) SET_UNIT iterators:
|
||||
-- ------------------------
|
||||
@@ -130,9 +130,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 4) @{Core.Set#SET_CLIENT} class, extends @{Core.Set#SET_BASE}
|
||||
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the @{Core.Set#SET_CLIENT} class to build sets of units belonging to certain:
|
||||
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
-- * Categories
|
||||
@@ -148,7 +148,7 @@
|
||||
--
|
||||
-- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
|
||||
-- -----------------------------------------
|
||||
-- CLIENTs can be added and removed using the @{Core.Set#SET_CLIENT.AddClientsByName} and @{Core.Set#SET_CLIENT.RemoveClientsByName} respectively.
|
||||
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
|
||||
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
|
||||
--
|
||||
-- 4.3) SET_CLIENT filter criteria:
|
||||
@@ -168,7 +168,7 @@
|
||||
--
|
||||
-- Planned filter criteria within development are (so these are not yet available):
|
||||
--
|
||||
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Core.Zone#ZONE}.
|
||||
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
|
||||
--
|
||||
-- 4.4) SET_CLIENT iterators:
|
||||
-- ------------------------
|
||||
@@ -180,9 +180,9 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 5) @{Core.Set#SET_AIRBASE} class, extends @{Core.Set#SET_BASE}
|
||||
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
|
||||
-- ====================================================
|
||||
-- Mission designers can use the @{Core.Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
|
||||
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
--
|
||||
@@ -194,7 +194,7 @@
|
||||
--
|
||||
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
|
||||
-- --------------------------------------------
|
||||
-- AIRBASEs can be added and removed using the @{Core.Set#SET_AIRBASE.AddAirbasesByName} and @{Core.Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
|
||||
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
|
||||
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
|
||||
--
|
||||
-- 5.3) SET_AIRBASE filter criteria
|
||||
@@ -269,7 +269,7 @@ function SET_BASE:New( Database )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Finds an @{Core.Base#BASE} object based on the object Name.
|
||||
--- Finds an @{Base#BASE} object based on the object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @return Core.Base#BASE The Object found.
|
||||
@@ -289,7 +289,7 @@ function SET_BASE:GetSet()
|
||||
return self.Set
|
||||
end
|
||||
|
||||
--- Adds a @{Core.Base#BASE} object in the @{Core.Set#SET_BASE}, using a given ObjectName as the index.
|
||||
--- Adds a @{Base#BASE} object in the @{Set#SET_BASE}, using a given ObjectName as the index.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @param Core.Base#BASE Object
|
||||
@@ -315,7 +315,7 @@ function SET_BASE:Add( ObjectName, Object )
|
||||
|
||||
end
|
||||
|
||||
--- Adds a @{Core.Base#BASE} object in the @{Core.Set#SET_BASE}, using the Object Name as the index.
|
||||
--- Adds a @{Base#BASE} object in the @{Set#SET_BASE}, using the Object Name as the index.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Wrapper.Object#OBJECT Object
|
||||
-- @return Core.Base#BASE The added BASE Object.
|
||||
@@ -330,7 +330,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- Removes a @{Core.Base#BASE} object from the @{Core.Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
--- Removes a @{Base#BASE} object from the @{Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
function SET_BASE:Remove( ObjectName )
|
||||
@@ -369,7 +369,7 @@ function SET_BASE:Remove( ObjectName )
|
||||
|
||||
end
|
||||
|
||||
--- Gets a @{Core.Base#BASE} object from the @{Core.Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
--- Gets a @{Base#BASE} object from the @{Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @return Core.Base#BASE
|
||||
@@ -384,7 +384,7 @@ function SET_BASE:Get( ObjectName )
|
||||
|
||||
end
|
||||
|
||||
--- Retrieves the amount of objects in the @{Core.Set#SET_BASE} and derived classes.
|
||||
--- Retrieves the amount of objects in the @{Set#SET_BASE} and derived classes.
|
||||
-- @param #SET_BASE self
|
||||
-- @return #number Count
|
||||
function SET_BASE:Count()
|
||||
@@ -477,9 +477,9 @@ function SET_BASE:FilterStop()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_BASE while identifying the nearest object from a @{Core.Point#POINT_VEC2}.
|
||||
--- Iterate the SET_BASE while identifying the nearest object from a @{Point#POINT_VEC2}.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||
-- @return Core.Base#BASE The closest object.
|
||||
function SET_BASE:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
self:F2( PointVec2 )
|
||||
@@ -2226,10 +2226,10 @@ function SET_AIRBASE:ForEachAirbase( IteratorFunction, ... )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Wrapper.Airbase#AIRBASE} from a @{Core.Point#POINT_VEC2}.
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Airbase#AIRBASE} from a @{Point#POINT_VEC2}.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @return Wrapper.Airbase#AIRBASE The closest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest @{Airbase#AIRBASE}.
|
||||
-- @return Wrapper.Airbase#AIRBASE The closest @{Airbase#AIRBASE}.
|
||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
self:F2( PointVec2 )
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--- This module contains the ZONE classes, inherited from @{Core.Zone#ZONE_BASE}.
|
||||
--- This module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
|
||||
-- There are essentially two core functions that zones accomodate:
|
||||
--
|
||||
-- * Test if an object is within the zone boundaries.
|
||||
@@ -7,7 +7,7 @@
|
||||
-- The object classes are using the zone classes to test the zone boundaries, which can take various forms:
|
||||
--
|
||||
-- * Test if completely within the zone.
|
||||
-- * Test if partly within the zone (for @{Wrapper.Group#GROUP} objects).
|
||||
-- * Test if partly within the zone (for @{Group#GROUP} objects).
|
||||
-- * Test if not in the zone.
|
||||
-- * Distance to the nearest intersecting point of the zone.
|
||||
-- * Distance to the center of the zone.
|
||||
@@ -15,16 +15,16 @@
|
||||
--
|
||||
-- Each of these ZONE classes have a zone name, and specific parameters defining the zone type:
|
||||
--
|
||||
-- * @{Core.Zone#ZONE_BASE}: The ZONE_BASE class defining the base for all other zone classes.
|
||||
-- * @{Core.Zone#ZONE_RADIUS}: The ZONE_RADIUS class defined by a zone name, a location and a radius.
|
||||
-- * @{Core.Zone#ZONE}: The ZONE class, defined by the zone name as defined within the Mission Editor.
|
||||
-- * @{Core.Zone#ZONE_UNIT}: The ZONE_UNIT class defines by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||
-- * @{Core.Zone#ZONE_GROUP}: The ZONE_GROUP class defines by a zone around a @{Wrapper.Group#GROUP} with a radius.
|
||||
-- * @{Core.Zone#ZONE_POLYGON}: The ZONE_POLYGON class defines by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- * @{Zone#ZONE_BASE}: The ZONE_BASE class defining the base for all other zone classes.
|
||||
-- * @{Zone#ZONE_RADIUS}: The ZONE_RADIUS class defined by a zone name, a location and a radius.
|
||||
-- * @{Zone#ZONE}: The ZONE class, defined by the zone name as defined within the Mission Editor.
|
||||
-- * @{Zone#ZONE_UNIT}: The ZONE_UNIT class defines by a zone around a @{Unit#UNIT} with a radius.
|
||||
-- * @{Zone#ZONE_GROUP}: The ZONE_GROUP class defines by a zone around a @{Group#GROUP} with a radius.
|
||||
-- * @{Zone#ZONE_POLYGON}: The ZONE_POLYGON class defines by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Core.Zone#ZONE_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{Zone#ZONE_BASE} class, extends @{Base#BASE}
|
||||
-- ================================================
|
||||
-- This class is an abstract BASE class for derived classes, and is not meant to be instantiated.
|
||||
--
|
||||
@@ -32,10 +32,10 @@
|
||||
--
|
||||
-- * @{#ZONE_BASE.GetName}(): Returns the name of the zone.
|
||||
--
|
||||
-- ### 1.2) Each zone implements two polymorphic functions defined in @{Core.Zone#ZONE_BASE}:
|
||||
-- ### 1.2) Each zone implements two polymorphic functions defined in @{Zone#ZONE_BASE}:
|
||||
--
|
||||
-- * @{#ZONE_BASE.IsPointVec2InZone}(): Returns if a @{Core.Point#POINT_VEC2} is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec3InZone}(): Returns if a @{Core.Point#POINT_VEC3} is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec2InZone}(): Returns if a @{Point#POINT_VEC2} is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec3InZone}(): Returns if a @{Point#POINT_VEC3} is within the zone.
|
||||
--
|
||||
-- ### 1.3) A zone has a probability factor that can be set to randomize a selection between zones:
|
||||
--
|
||||
@@ -45,8 +45,8 @@
|
||||
--
|
||||
-- ### 1.4) A zone manages Vectors:
|
||||
--
|
||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{DCSTypes#Vec2} coordinate of the zone.
|
||||
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{DCSTypes#Vec2} within the zone.
|
||||
--
|
||||
-- ### 1.5) A zone has a bounding square:
|
||||
--
|
||||
@@ -59,12 +59,12 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Core.Zone#ZONE_RADIUS} class, extends @{Core.Zone#ZONE_BASE}
|
||||
-- 2) @{Zone#ZONE_RADIUS} class, extends @{Zone#ZONE_BASE}
|
||||
-- =======================================================
|
||||
-- The ZONE_RADIUS class defined by a zone name, a location and a radius.
|
||||
-- This class implements the inherited functions from Core.Zone#ZONE_BASE taking into account the own zone format and properties.
|
||||
--
|
||||
-- ### 2.1) @{Core.Zone#ZONE_RADIUS} constructor:
|
||||
-- ### 2.1) @{Zone#ZONE_RADIUS} constructor:
|
||||
--
|
||||
-- * @{#ZONE_BASE.New}(): Constructor.
|
||||
--
|
||||
@@ -75,45 +75,45 @@
|
||||
--
|
||||
-- ### 2.3) Manage the location of the zone:
|
||||
--
|
||||
-- * @{#ZONE_BASE.SetVec2}(): Sets the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
-- * @{#ZONE_BASE.GetVec3}(): Returns the @{Dcs.DCSTypes#Vec3} of the zone, taking an additional height parameter.
|
||||
-- * @{#ZONE_BASE.SetVec2}(): Sets the @{DCSTypes#Vec2} of the zone.
|
||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{DCSTypes#Vec2} of the zone.
|
||||
-- * @{#ZONE_BASE.GetVec3}(): Returns the @{DCSTypes#Vec3} of the zone, taking an additional height parameter.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 3) @{Core.Zone#ZONE} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- 3) @{Zone#ZONE} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- ==========================================
|
||||
-- The ZONE class, defined by the zone name as defined within the Mission Editor.
|
||||
-- This class implements the inherited functions from {Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 4) @{Core.Zone#ZONE_UNIT} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- 4) @{Zone#ZONE_UNIT} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- =======================================================
|
||||
-- The ZONE_UNIT class defined by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
|
||||
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 5) @{Core.Zone#ZONE_GROUP} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- 5) @{Zone#ZONE_GROUP} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- =======================================================
|
||||
-- The ZONE_GROUP class defines by a zone around a @{Wrapper.Group#GROUP} with a radius. The current leader of the group defines the center of the zone.
|
||||
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- The ZONE_GROUP class defines by a zone around a @{Group#GROUP} with a radius. The current leader of the group defines the center of the zone.
|
||||
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 6) @{Core.Zone#ZONE_POLYGON_BASE} class, extends @{Core.Zone#ZONE_BASE}
|
||||
-- 6) @{Zone#ZONE_POLYGON_BASE} class, extends @{Zone#ZONE_BASE}
|
||||
-- ========================================================
|
||||
-- The ZONE_POLYGON_BASE class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- The ZONE_POLYGON_BASE class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- This class is an abstract BASE class for derived classes, and is not meant to be instantiated.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 7) @{Core.Zone#ZONE_POLYGON} class, extends @{Core.Zone#ZONE_POLYGON_BASE}
|
||||
-- 7) @{Zone#ZONE_POLYGON} class, extends @{Zone#ZONE_POLYGON_BASE}
|
||||
-- ================================================================
|
||||
-- The ZONE_POLYGON class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- This class implements the inherited functions from @{Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
@@ -204,7 +204,7 @@ function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
||||
return InZone
|
||||
end
|
||||
|
||||
--- Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||
--- Returns the @{DCSTypes#Vec2} coordinate of the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return #nil.
|
||||
function ZONE_BASE:GetVec2()
|
||||
@@ -212,7 +212,7 @@ function ZONE_BASE:GetVec2()
|
||||
|
||||
return nil
|
||||
end
|
||||
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinates.
|
||||
function ZONE_BASE:GetRandomVec2()
|
||||
@@ -374,7 +374,7 @@ function ZONE_RADIUS:SetRadius( Radius )
|
||||
return self.Radius
|
||||
end
|
||||
|
||||
--- Returns the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
--- Returns the @{DCSTypes#Vec2} of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone.
|
||||
function ZONE_RADIUS:GetVec2()
|
||||
@@ -385,7 +385,7 @@ function ZONE_RADIUS:GetVec2()
|
||||
return self.Vec2
|
||||
end
|
||||
|
||||
--- Sets the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
--- Sets the @{DCSTypes#Vec2} of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The new location of the zone.
|
||||
-- @return Dcs.DCSTypes#Vec2 The new location of the zone.
|
||||
@@ -399,7 +399,7 @@ function ZONE_RADIUS:SetVec2( Vec2 )
|
||||
return self.Vec2
|
||||
end
|
||||
|
||||
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_RADIUS.
|
||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_RADIUS.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param Dcs.DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return Dcs.DCSTypes#Vec3 The point of the zone.
|
||||
@@ -501,7 +501,7 @@ function ZONE:New( ZoneName )
|
||||
end
|
||||
|
||||
|
||||
--- The ZONE_UNIT class defined by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||
--- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
|
||||
-- @type ZONE_UNIT
|
||||
-- @field Wrapper.Unit#UNIT ZoneUNIT
|
||||
-- @extends Core.Zone#ZONE_RADIUS
|
||||
@@ -526,9 +526,9 @@ function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
|
||||
end
|
||||
|
||||
|
||||
--- Returns the current location of the @{Wrapper.Unit#UNIT}.
|
||||
--- Returns the current location of the @{Unit#UNIT}.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone based on the @{Wrapper.Unit#UNIT}location.
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone based on the @{Unit#UNIT}location.
|
||||
function ZONE_UNIT:GetVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@@ -567,7 +567,7 @@ function ZONE_UNIT:GetRandomVec2()
|
||||
return RandomVec2
|
||||
end
|
||||
|
||||
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_UNIT.
|
||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_UNIT.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @param Dcs.DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return Dcs.DCSTypes#Vec3 The point of the zone.
|
||||
@@ -593,7 +593,7 @@ ZONE_GROUP = {
|
||||
ClassName="ZONE_GROUP",
|
||||
}
|
||||
|
||||
--- Constructor to create a ZONE_GROUP instance, taking the zone name, a zone @{Wrapper.Group#GROUP} and a radius.
|
||||
--- Constructor to create a ZONE_GROUP instance, taking the zone name, a zone @{Group#GROUP} and a radius.
|
||||
-- @param #ZONE_GROUP self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param Wrapper.Group#GROUP ZoneGROUP The @{Group} as the center of the zone.
|
||||
@@ -644,9 +644,9 @@ end
|
||||
|
||||
-- Polygons
|
||||
|
||||
--- The ZONE_POLYGON_BASE class defined by an array of @{Dcs.DCSTypes#Vec2}, forming a polygon.
|
||||
--- The ZONE_POLYGON_BASE class defined by an array of @{DCSTypes#Vec2}, forming a polygon.
|
||||
-- @type ZONE_POLYGON_BASE
|
||||
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{Dcs.DCSTypes#Vec2}.
|
||||
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{DCSTypes#Vec2}.
|
||||
-- @extends Core.Zone#ZONE_BASE
|
||||
ZONE_POLYGON_BASE = {
|
||||
ClassName="ZONE_POLYGON_BASE",
|
||||
@@ -656,11 +656,11 @@ ZONE_POLYGON_BASE = {
|
||||
-- @type ZONE_POLYGON_BASE.ListVec2
|
||||
-- @list <Dcs.DCSTypes#Vec2>
|
||||
|
||||
--- Constructor to create a ZONE_POLYGON_BASE instance, taking the zone name and an array of @{Dcs.DCSTypes#Vec2}, forming a polygon.
|
||||
-- The @{Wrapper.Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected.
|
||||
--- Constructor to create a ZONE_POLYGON_BASE instance, taking the zone name and an array of @{DCSTypes#Vec2}, forming a polygon.
|
||||
-- The @{Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param #ZONE_POLYGON_BASE.ListVec2 PointsArray An array of @{Dcs.DCSTypes#Vec2}, forming a polygon..
|
||||
-- @param #ZONE_POLYGON_BASE.ListVec2 PointsArray An array of @{DCSTypes#Vec2}, forming a polygon..
|
||||
-- @return #ZONE_POLYGON_BASE self
|
||||
function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
|
||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
||||
@@ -757,7 +757,7 @@ function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
||||
return InPolygon
|
||||
end
|
||||
|
||||
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinate.
|
||||
function ZONE_POLYGON_BASE:GetRandomVec2()
|
||||
@@ -809,15 +809,15 @@ end
|
||||
|
||||
|
||||
|
||||
--- The ZONE_POLYGON class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
--- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- @type ZONE_POLYGON
|
||||
-- @extends Core.Zone#ZONE_POLYGON_BASE
|
||||
ZONE_POLYGON = {
|
||||
ClassName="ZONE_POLYGON",
|
||||
}
|
||||
|
||||
--- Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the @{Wrapper.Group#GROUP} defined within the Mission Editor.
|
||||
-- The @{Wrapper.Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.
|
||||
--- Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the @{Group#GROUP} defined within the Mission Editor.
|
||||
-- The @{Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.
|
||||
-- @param #ZONE_POLYGON self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param Wrapper.Group#GROUP ZoneGroup The GROUP waypoints as defined within the Mission Editor define the polygon shape.
|
||||
|
||||
Reference in New Issue
Block a user