mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
New File Structure Updates
This commit is contained in:
parent
931464dfec
commit
dd162831fa
@ -13,8 +13,8 @@
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- 1.2) BASE Trace functionality
|
||||
-- -----------------------------
|
||||
@ -199,7 +199,7 @@ end
|
||||
|
||||
--- Set a new listener for the class.
|
||||
-- @param self
|
||||
-- @param DCSTypes#Event Event
|
||||
-- @param Dcs.DCSTypes#Event Event
|
||||
-- @param #function EventFunction
|
||||
-- @return #BASE
|
||||
function BASE:AddEvent( Event, EventFunction )
|
||||
@ -215,7 +215,7 @@ end
|
||||
|
||||
--- Returns the event dispatcher
|
||||
-- @param #BASE self
|
||||
-- @return Event#EVENT
|
||||
-- @return Core.Event#EVENT
|
||||
function BASE:Event()
|
||||
|
||||
return _EVENTDISPATCHER
|
||||
@ -563,8 +563,8 @@ local BaseEventCodes = {
|
||||
|
||||
--- Creation of a Birth Event.
|
||||
-- @param #BASE self
|
||||
-- @param DCSTypes#Time EventTime The time stamp of the event.
|
||||
-- @param DCSObject#Object Initiator The initiating object of the event.
|
||||
-- @param Dcs.DCSTypes#Time EventTime The time stamp of the event.
|
||||
-- @param Dcs.DCSWrapper.Object#Object Initiator The initiating object of the event.
|
||||
-- @param #string IniUnitName The initiating unit name.
|
||||
-- @param place
|
||||
-- @param subplace
|
||||
@ -585,8 +585,8 @@ end
|
||||
|
||||
--- Creation of a Crash Event.
|
||||
-- @param #BASE self
|
||||
-- @param DCSTypes#Time EventTime The time stamp of the event.
|
||||
-- @param DCSObject#Object Initiator The initiating object of the event.
|
||||
-- @param Dcs.DCSTypes#Time EventTime The time stamp of the event.
|
||||
-- @param Dcs.DCSWrapper.Object#Object Initiator The initiating object of the event.
|
||||
function BASE:CreateEventCrash( EventTime, Initiator )
|
||||
self:F( { EventTime, Initiator } )
|
||||
|
||||
@ -599,10 +599,10 @@ function BASE:CreateEventCrash( EventTime, Initiator )
|
||||
world.onEvent( Event )
|
||||
end
|
||||
|
||||
-- TODO: Complete DCSTypes#Event structure.
|
||||
-- TODO: Complete Dcs.DCSTypes#Event structure.
|
||||
--- The main event handling function... This function captures all events generated for the class.
|
||||
-- @param #BASE self
|
||||
-- @param DCSTypes#Event event
|
||||
-- @param Dcs.DCSTypes#Event event
|
||||
function BASE:onEvent(event)
|
||||
--self:F( { BaseEventCodes[event.id], event } )
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 1) @{Database#DATABASE} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Database#DATABASE} class, extends @{Core.Base#BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the DATABASE class to refer to:
|
||||
--
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
--- DATABASE class
|
||||
-- @type DATABASE
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
DATABASE = {
|
||||
ClassName = "DATABASE",
|
||||
Templates = {
|
||||
@ -106,7 +106,7 @@ end
|
||||
--- Finds a Unit based on the Unit Name.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string UnitName
|
||||
-- @return Unit#UNIT The found Unit.
|
||||
-- @return Wrapper.Unit#UNIT The found Unit.
|
||||
function DATABASE:FindUnit( UnitName )
|
||||
|
||||
local UnitFound = self.UNITS[UnitName]
|
||||
@ -154,7 +154,7 @@ end
|
||||
--- Finds a STATIC based on the StaticName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string StaticName
|
||||
-- @return Static#STATIC The found STATIC.
|
||||
-- @return Wrapper.Static#STATIC The found STATIC.
|
||||
function DATABASE:FindStatic( StaticName )
|
||||
|
||||
local StaticFound = self.STATICS[StaticName]
|
||||
@ -181,7 +181,7 @@ end
|
||||
--- Finds a AIRBASE based on the AirbaseName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string AirbaseName
|
||||
-- @return Airbase#AIRBASE The found AIRBASE.
|
||||
-- @return Wrapper.Airbase#AIRBASE The found AIRBASE.
|
||||
function DATABASE:FindAirbase( AirbaseName )
|
||||
|
||||
local AirbaseFound = self.AIRBASES[AirbaseName]
|
||||
@ -192,7 +192,7 @@ end
|
||||
--- Finds a CLIENT based on the ClientName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string ClientName
|
||||
-- @return Client#CLIENT The found CLIENT.
|
||||
-- @return Wrapper.Client#CLIENT The found CLIENT.
|
||||
function DATABASE:FindClient( ClientName )
|
||||
|
||||
local ClientFound = self.CLIENTS[ClientName]
|
||||
@ -215,7 +215,7 @@ end
|
||||
--- Finds a GROUP based on the GroupName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string GroupName
|
||||
-- @return Group#GROUP The found GROUP.
|
||||
-- @return Wrapper.Group#GROUP The found GROUP.
|
||||
function DATABASE:FindGroup( GroupName )
|
||||
|
||||
local GroupFound = self.GROUPS[GroupName]
|
||||
@ -535,7 +535,7 @@ end
|
||||
|
||||
--- Handles the OnBirth event for the alive units set.
|
||||
-- @param #DATABASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function DATABASE:_EventOnBirth( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
@ -549,7 +549,7 @@ end
|
||||
|
||||
--- Handles the OnDead or OnCrash event for alive units set.
|
||||
-- @param #DATABASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function DATABASE:_EventOnDeadOrCrash( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
@ -564,7 +564,7 @@ end
|
||||
|
||||
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
||||
-- @param #DATABASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
@ -579,7 +579,7 @@ end
|
||||
|
||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||
-- @param #DATABASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ end
|
||||
|
||||
--- Initializes the Events structure for the event
|
||||
-- @param #EVENT self
|
||||
-- @param DCSWorld#world.event EventID
|
||||
-- @param Dcs.DCSWorld#world.event EventID
|
||||
-- @param Core.Base#BASE EventClass
|
||||
-- @return #EVENT.Events
|
||||
function EVENT:Init( EventID, EventClass )
|
||||
@ -104,7 +104,7 @@ end
|
||||
--- Removes an Events entry
|
||||
-- @param #EVENT self
|
||||
-- @param Core.Base#BASE EventClass The self instance of the class for which the event is.
|
||||
-- @param DCSWorld#world.event EventID
|
||||
-- @param Dcs.DCSWorld#world.event EventID
|
||||
-- @return #EVENT.Events
|
||||
function EVENT:Remove( EventClass, EventID )
|
||||
self:F3( { EventClass, _EVENTCODES[EventID] } )
|
||||
@ -146,7 +146,7 @@ end
|
||||
--- Set a new listener for an S_EVENT_X event independent from a unit or a weapon.
|
||||
-- @param #EVENT self
|
||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
||||
-- @param Base#BASE EventClass The self instance of the class for which the event is captured. When the event happens, the event process will be called in this class provided.
|
||||
-- @param Core.Base#BASE EventClass The self instance of the class for which the event is captured. When the event happens, the event process will be called in this class provided.
|
||||
-- @param EventID
|
||||
-- @return #EVENT
|
||||
function EVENT:OnEventGeneric( EventFunction, EventClass, EventID )
|
||||
@ -163,7 +163,7 @@ end
|
||||
-- @param #EVENT self
|
||||
-- @param #string EventDCSUnitName
|
||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
||||
-- @param Base#BASE EventClass The self instance of the class for which the event is.
|
||||
-- @param Core.Base#BASE EventClass The self instance of the class for which the event is.
|
||||
-- @param EventID
|
||||
-- @return #EVENT
|
||||
function EVENT:OnEventForUnit( EventDCSUnitName, EventFunction, EventClass, EventID )
|
||||
@ -183,7 +183,7 @@ do -- OnBirth
|
||||
|
||||
--- Create an OnBirth event handler for a group
|
||||
-- @param #EVENT self
|
||||
-- @param Group#GROUP EventGroup
|
||||
-- @param Wrapper.Group#GROUP EventGroup
|
||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
||||
-- @param EventClass The self instance of the class for which the event is.
|
||||
-- @return #EVENT
|
||||
@ -241,7 +241,7 @@ do -- OnCrash
|
||||
|
||||
--- Create an OnCrash event handler for a group
|
||||
-- @param #EVENT self
|
||||
-- @param Group#GROUP EventGroup
|
||||
-- @param Wrapper.Group#GROUP EventGroup
|
||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
||||
-- @param EventClass The self instance of the class for which the event is.
|
||||
-- @return #EVENT
|
||||
@ -298,7 +298,7 @@ do -- OnDead
|
||||
|
||||
--- Create an OnDead event handler for a group
|
||||
-- @param #EVENT self
|
||||
-- @param Group#GROUP EventGroup
|
||||
-- @param Wrapper.Group#GROUP EventGroup
|
||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
||||
-- @param EventClass The self instance of the class for which the event is.
|
||||
-- @return #EVENT
|
||||
|
||||
@ -15,17 +15,17 @@
|
||||
--
|
||||
-- ### To manage **main menus**, the classes begin with **MENU_**:
|
||||
--
|
||||
-- * @{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".
|
||||
-- * @{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".
|
||||
--
|
||||
-- ### To manage **command menus**, which are menus that allow the player to issue **functions**, the classes begin with **MENU_COMMAND_**:
|
||||
--
|
||||
-- * @{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".
|
||||
-- * @{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".
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -37,11 +37,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) @{Menu#MENU_BASE} class, extends @{Base#BASE}
|
||||
-- 1.1) @{Core.Menu#MENU_BASE} class, extends @{Core.Base#BASE}
|
||||
-- --------------------------------------------------
|
||||
-- The @{#MENU_BASE} class defines the main MENU class where other MENU classes are derived from.
|
||||
--
|
||||
-- 1.2) @{Menu#MENU_COMMAND_BASE} class, extends @{Base#BASE}
|
||||
-- 1.2) @{Core.Menu#MENU_COMMAND_BASE} class, extends @{Core.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 +53,15 @@
|
||||
-- ======================
|
||||
-- The underlying classes manage the menus for a complete mission file.
|
||||
--
|
||||
-- 2.1) @{Menu#MENU_MISSION} class, extends @{Menu#MENU_BASE}
|
||||
-- 2.1) @{Menu#MENU_MISSION} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- ---------------------------------------------------------
|
||||
-- The @{Menu#MENU_MISSION} class manages the main menus for a complete mission.
|
||||
-- The @{Core.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 @{Menu#MENU_COMMAND_BASE}
|
||||
-- 2.2) @{Menu#MENU_MISSION_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- -------------------------------------------------------------------------
|
||||
-- The @{Menu#MENU_MISSION_COMMAND} class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
|
||||
-- The @{Core.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 +71,15 @@
|
||||
-- =========================
|
||||
-- The underlying classes manage the menus for whole coalitions.
|
||||
--
|
||||
-- 3.1) @{Menu#MENU_COALITION} class, extends @{Menu#MENU_BASE}
|
||||
-- 3.1) @{Menu#MENU_COALITION} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- ------------------------------------------------------------
|
||||
-- The @{Menu#MENU_COALITION} class manages the main menus for coalitions.
|
||||
-- The @{Core.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 @{Menu#MENU_COMMAND_BASE}
|
||||
-- 3.2) @{Menu#MENU_COALITION_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- ----------------------------------------------------------------------------
|
||||
-- The @{Menu#MENU_COALITION_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Core.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 +89,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 @{Menu#MENU_BASE}
|
||||
-- 4.1) @{Menu#MENU_GROUP} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- --------------------------------------------------------
|
||||
-- The @{Menu#MENU_GROUP} class manages the main menus for coalitions.
|
||||
-- The @{Core.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 @{Menu#MENU_COMMAND_BASE}
|
||||
-- 4.2) @{Menu#MENU_GROUP_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- ------------------------------------------------------------------------
|
||||
-- The @{Menu#MENU_GROUP_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Core.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 +107,15 @@
|
||||
-- ======================
|
||||
-- The underlying classes manage the menus for units with skill level client or player.
|
||||
--
|
||||
-- 5.1) @{Menu#MENU_CLIENT} class, extends @{Menu#MENU_BASE}
|
||||
-- 5.1) @{Menu#MENU_CLIENT} class, extends @{Core.Menu#MENU_BASE}
|
||||
-- ---------------------------------------------------------
|
||||
-- The @{Menu#MENU_CLIENT} class manages the main menus for coalitions.
|
||||
-- The @{Core.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 @{Menu#MENU_COMMAND_BASE}
|
||||
-- 5.2) @{Menu#MENU_CLIENT_COMMAND} class, extends @{Core.Menu#MENU_COMMAND_BASE}
|
||||
-- -------------------------------------------------------------------------
|
||||
-- The @{Menu#MENU_CLIENT_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
|
||||
-- The @{Core.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}.
|
||||
--
|
||||
@ -351,7 +351,7 @@ do -- MENU_COALITION
|
||||
|
||||
--- MENU_COALITION constructor. Creates a new MENU_COALITION object and creates the menu for a complete coalition.
|
||||
-- @param #MENU_COALITION self
|
||||
-- @param DCSCoalition#coalition.side Coalition The coalition owning the menu.
|
||||
-- @param Dcs.DCSCoalition#coalition.side Coalition The coalition owning the menu.
|
||||
-- @param #string MenuText The text for the menu.
|
||||
-- @param #table ParentMenu The parent menu. This parameter can be ignored if you want the menu to be located at the perent menu of DCS world (under F10 other).
|
||||
-- @return #MENU_COALITION self
|
||||
@ -420,7 +420,7 @@ do -- MENU_COALITION_COMMAND
|
||||
|
||||
--- MENU_COALITION constructor. Creates a new radio command item for a coalition, which can invoke a function with parameters.
|
||||
-- @param #MENU_COALITION_COMMAND self
|
||||
-- @param DCSCoalition#coalition.side Coalition The coalition owning the menu.
|
||||
-- @param Dcs.DCSCoalition#coalition.side Coalition The coalition owning the menu.
|
||||
-- @param #string MenuText The text for the menu.
|
||||
-- @param Menu#MENU_COALITION ParentMenu The parent menu.
|
||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||
@ -493,7 +493,7 @@ do -- MENU_CLIENT
|
||||
-- MenuStatus[MenuClientName]:Remove()
|
||||
-- end
|
||||
--
|
||||
-- --- @param Client#CLIENT MenuClient
|
||||
-- --- @param Wrapper.Client#CLIENT MenuClient
|
||||
-- local function AddStatusMenu( MenuClient )
|
||||
-- local MenuClientName = MenuClient:GetName()
|
||||
-- -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
@ -526,7 +526,7 @@ do -- MENU_CLIENT
|
||||
|
||||
--- MENU_CLIENT constructor. Creates a new radio menu item for a client.
|
||||
-- @param #MENU_CLIENT self
|
||||
-- @param Client#CLIENT Client The Client owning the menu.
|
||||
-- @param Wrapper.Client#CLIENT Client The Client owning the menu.
|
||||
-- @param #string MenuText The text for the menu.
|
||||
-- @param #table ParentMenu The parent menu.
|
||||
-- @return #MENU_CLIENT self
|
||||
@ -618,7 +618,7 @@ do -- MENU_CLIENT
|
||||
|
||||
--- MENU_CLIENT_COMMAND constructor. Creates a new radio command item for a client, which can invoke a function with parameters.
|
||||
-- @param #MENU_CLIENT_COMMAND self
|
||||
-- @param Client#CLIENT Client The Client owning the menu.
|
||||
-- @param Wrapper.Client#CLIENT Client The Client owning the menu.
|
||||
-- @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.
|
||||
@ -719,7 +719,7 @@ do
|
||||
-- MenuStatus[MenuGroupName]:Remove()
|
||||
-- end
|
||||
--
|
||||
-- --- @param Group#GROUP MenuGroup
|
||||
-- --- @param Wrapper.Group#GROUP MenuGroup
|
||||
-- local function AddStatusMenu( MenuGroup )
|
||||
-- local MenuGroupName = MenuGroup:GetName()
|
||||
-- -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
@ -753,7 +753,7 @@ do
|
||||
|
||||
--- MENU_GROUP constructor. Creates a new radio menu item for a group.
|
||||
-- @param #MENU_GROUP self
|
||||
-- @param Group#GROUP MenuGroup The Group owning the menu.
|
||||
-- @param Wrapper.Group#GROUP MenuGroup The Group owning the menu.
|
||||
-- @param #string MenuText The text for the menu.
|
||||
-- @param #table ParentMenu The parent menu.
|
||||
-- @return #MENU_GROUP self
|
||||
@ -835,7 +835,7 @@ do
|
||||
|
||||
--- Creates a new radio command item for a group
|
||||
-- @param #MENU_GROUP_COMMAND self
|
||||
-- @param Group#GROUP MenuGroup The Group owning the menu.
|
||||
-- @param Wrapper.Group#GROUP MenuGroup The Group owning the menu.
|
||||
-- @param MenuText The text for the menu.
|
||||
-- @param ParentMenu The parent menu.
|
||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- This module contains the MESSAGE class.
|
||||
--
|
||||
-- 1) @{Message#MESSAGE} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Message#MESSAGE} class, extends @{Core.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,23 +8,23 @@
|
||||
--
|
||||
-- 1.1) MESSAGE construction methods
|
||||
-- ---------------------------------
|
||||
-- Messages are created with @{Message#MESSAGE.New}. Note that when the MESSAGE object is created, no message is sent yet.
|
||||
-- Messages are created with @{Core.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 @{Message#MESSAGE.ToClient}.
|
||||
-- * Coalitions with @{Message#MESSAGE.ToCoalition}.
|
||||
-- * All Players with @{Message#MESSAGE.ToAll}.
|
||||
-- * Clients with @{Core.Message#MESSAGE.ToClient}.
|
||||
-- * Coalitions with @{Core.Message#MESSAGE.ToCoalition}.
|
||||
-- * All Players with @{Core.Message#MESSAGE.ToAll}.
|
||||
--
|
||||
-- @module Message
|
||||
-- @author FlightControl
|
||||
|
||||
--- The MESSAGE class
|
||||
-- @type MESSAGE
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
MESSAGE = {
|
||||
ClassName = "MESSAGE",
|
||||
MessageCategory = 0,
|
||||
@ -76,7 +76,7 @@ end
|
||||
|
||||
--- Sends a MESSAGE to a Client Group. Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".
|
||||
-- @param #MESSAGE self
|
||||
-- @param Client#CLIENT Client is the Group of the Client.
|
||||
-- @param Wrapper.Client#CLIENT Client is the Group of the Client.
|
||||
-- @return #MESSAGE
|
||||
-- @usage
|
||||
-- -- Send the 2 messages created with the @{New} method to the Client Group.
|
||||
@ -108,7 +108,7 @@ end
|
||||
|
||||
--- Sends a MESSAGE to a Group.
|
||||
-- @param #MESSAGE self
|
||||
-- @param Group#GROUP Group is the Group.
|
||||
-- @param Wrapper.Group#GROUP Group is the Group.
|
||||
-- @return #MESSAGE
|
||||
function MESSAGE:ToGroup( Group )
|
||||
self:F( Group.GroupName )
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- This module contains the POINT classes.
|
||||
--
|
||||
-- 1) @{Point#POINT_VEC3} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Point#POINT_VEC3} class, extends @{Core.Base#BASE}
|
||||
-- ==================================================
|
||||
-- The @{Point#POINT_VEC3} class defines a 3D point in the simulator.
|
||||
-- The @{Core.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.
|
||||
@ -12,19 +12,19 @@
|
||||
-- A new POINT_VEC3 instance can be created with:
|
||||
--
|
||||
-- * @{#POINT_VEC3.New}(): a 3D point.
|
||||
-- * @{#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
|
||||
-- * @{#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{Dcs.DCSTypes#Vec3}.
|
||||
--
|
||||
--
|
||||
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
|
||||
-- 2) @{Core.Point#POINT_VEC2} class, extends @{Core.Point#POINT_VEC3}
|
||||
-- =========================================================
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- 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 @{DCSTypes#Vec2}.
|
||||
-- * @{#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{Dcs.DCSTypes#Vec2}.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -58,12 +58,12 @@
|
||||
|
||||
--- The POINT_VEC3 class
|
||||
-- @type POINT_VEC3
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
-- @field #number x The x coordinate in 3D space.
|
||||
-- @field #number y The y coordinate in 3D space.
|
||||
-- @field #number z The z coordiante in 3D space.
|
||||
-- @field #POINT_VEC3.SmokeColor SmokeColor
|
||||
-- @field Utils#FLARECOLOR FlareColor
|
||||
-- @field Utilities.Utils#FLARECOLOR FlareColor
|
||||
-- @field #POINT_VEC3.RoutePointAltType RoutePointAltType
|
||||
-- @field #POINT_VEC3.RoutePointType RoutePointType
|
||||
-- @field #POINT_VEC3.RoutePointAction RoutePointAction
|
||||
@ -84,8 +84,8 @@ POINT_VEC3 = {
|
||||
--- The POINT_VEC2 class
|
||||
-- @type POINT_VEC2
|
||||
-- @extends #POINT_VEC3
|
||||
-- @field DCSTypes#Distance x The x coordinate in meters.
|
||||
-- @field DCSTypes#Distance y the y coordinate in meters.
|
||||
-- @field Dcs.DCSTypes#Distance x The x coordinate in meters.
|
||||
-- @field Dcs.DCSTypes#Distance y the y coordinate in meters.
|
||||
POINT_VEC2 = {
|
||||
ClassName = "POINT_VEC2",
|
||||
}
|
||||
@ -109,10 +109,10 @@ do -- POINT_VEC3
|
||||
|
||||
--- Create a new POINT_VEC3 object.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
||||
-- @param DCSTypes#Distance y The y coordinate of the Vec3 point, pointing Upwards.
|
||||
-- @param DCSTypes#Distance z The z coordinate of the Vec3 point, pointing to the Right.
|
||||
-- @return Point#POINT_VEC3 self
|
||||
-- @param Dcs.DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
||||
-- @param Dcs.DCSTypes#Distance y The y coordinate of the Vec3 point, pointing Upwards.
|
||||
-- @param Dcs.DCSTypes#Distance z The z coordinate of the Vec3 point, pointing to the Right.
|
||||
-- @return Core.Point#POINT_VEC3 self
|
||||
function POINT_VEC3:New( x, y, z )
|
||||
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
@ -125,8 +125,8 @@ end
|
||||
|
||||
--- Create a new POINT_VEC3 object from Vec3 coordinates.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Point#POINT_VEC3 self
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Core.Point#POINT_VEC3 self
|
||||
function POINT_VEC3:NewFromVec3( Vec3 )
|
||||
|
||||
self = self:New( Vec3.x, Vec3.y, Vec3.z )
|
||||
@ -137,14 +137,14 @@ end
|
||||
|
||||
--- Return the coordinates of the POINT_VEC3 in Vec3 format.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @return DCSTypes#Vec3 The Vec3 coodinate.
|
||||
-- @return Dcs.DCSTypes#Vec3 The Vec3 coodinate.
|
||||
function POINT_VEC3:GetVec3()
|
||||
return { x = self.x, y = self.y, z = self.z }
|
||||
end
|
||||
|
||||
--- Return the coordinates of the POINT_VEC3 in Vec2 format.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @return DCSTypes#Vec2 The Vec2 coodinate.
|
||||
-- @return Dcs.DCSTypes#Vec2 The Vec2 coodinate.
|
||||
function POINT_VEC3:GetVec2()
|
||||
return { x = self.x, y = self.z }
|
||||
end
|
||||
@ -191,9 +191,9 @@ end
|
||||
|
||||
--- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance OuterRadius
|
||||
-- @param DCSTypes#Distance InnerRadius
|
||||
-- @return DCSTypes#Vec2 Vec2
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||
-- @return Dcs.DCSTypes#Vec2 Vec2
|
||||
function POINT_VEC3:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
||||
self:F2( { OuterRadius, InnerRadius } )
|
||||
|
||||
@ -222,8 +222,8 @@ end
|
||||
|
||||
--- Return a random POINT_VEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance OuterRadius
|
||||
-- @param DCSTypes#Distance InnerRadius
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC3:GetRandomPointVec2InRadius( OuterRadius, InnerRadius )
|
||||
self:F2( { OuterRadius, InnerRadius } )
|
||||
@ -233,9 +233,9 @@ end
|
||||
|
||||
--- Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance OuterRadius
|
||||
-- @param DCSTypes#Distance InnerRadius
|
||||
-- @return DCSTypes#Vec3 Vec3
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||
-- @return Dcs.DCSTypes#Vec3 Vec3
|
||||
function POINT_VEC3:GetRandomVec3InRadius( OuterRadius, InnerRadius )
|
||||
|
||||
local RandomVec2 = self:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
||||
@ -247,8 +247,8 @@ end
|
||||
|
||||
--- Return a random POINT_VEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance OuterRadius
|
||||
-- @param DCSTypes#Distance InnerRadius
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:GetRandomPointVec3InRadius( OuterRadius, InnerRadius )
|
||||
|
||||
@ -259,7 +259,7 @@ end
|
||||
--- Return a direction vector Vec3 from POINT_VEC3 to the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
||||
-- @return DCSTypes#Vec3 DirectionVec3 The direction vector in Vec3 format.
|
||||
-- @return Dcs.DCSTypes#Vec3 DirectionVec3 The direction vector in Vec3 format.
|
||||
function POINT_VEC3:GetDirectionVec3( TargetPointVec3 )
|
||||
return { x = TargetPointVec3:GetX() - self:GetX(), y = TargetPointVec3:GetY() - self:GetY(), z = TargetPointVec3:GetZ() - self:GetZ() }
|
||||
end
|
||||
@ -277,7 +277,7 @@ end
|
||||
|
||||
--- Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Vec3 DirectionVec3 The direction vector in Vec3 format.
|
||||
-- @param Dcs.DCSTypes#Vec3 DirectionVec3 The direction vector in Vec3 format.
|
||||
-- @return #number DirectionRadians The direction in radians.
|
||||
function POINT_VEC3:GetDirectionRadians( DirectionVec3 )
|
||||
local DirectionRadians = math.atan2( DirectionVec3.z, DirectionVec3.x )
|
||||
@ -291,7 +291,7 @@ end
|
||||
--- Return the 2D distance in meters between the target POINT_VEC3 and the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
||||
-- @return DCSTypes#Distance Distance The distance in meters.
|
||||
-- @return Dcs.DCSTypes#Distance Distance The distance in meters.
|
||||
function POINT_VEC3:Get2DDistance( TargetPointVec3 )
|
||||
local TargetVec3 = TargetPointVec3:GetVec3()
|
||||
local SourceVec3 = self:GetVec3()
|
||||
@ -301,7 +301,7 @@ end
|
||||
--- Return the 3D distance in meters between the target POINT_VEC3 and the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
||||
-- @return DCSTypes#Distance Distance The distance in meters.
|
||||
-- @return Dcs.DCSTypes#Distance Distance The distance in meters.
|
||||
function POINT_VEC3:Get3DDistance( TargetPointVec3 )
|
||||
local TargetVec3 = TargetPointVec3:GetVec3()
|
||||
local SourceVec3 = self:GetVec3()
|
||||
@ -379,8 +379,8 @@ end
|
||||
|
||||
--- Add a Distance in meters from the POINT_VEC3 horizontal plane, with the given angle, and calculate the new POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Distance Distance The Distance to be added in meters.
|
||||
-- @param DCSTypes#Angle Angle The Angle in degrees.
|
||||
-- @param Dcs.DCSTypes#Distance Distance The Distance to be added in meters.
|
||||
-- @param Dcs.DCSTypes#Angle Angle The Angle in degrees.
|
||||
-- @return #POINT_VEC3 The new calculated POINT_VEC3.
|
||||
function POINT_VEC3:Translate( Distance, Angle )
|
||||
local SX = self:GetX()
|
||||
@ -399,7 +399,7 @@ end
|
||||
-- @param #POINT_VEC3.RoutePointAltType AltType The altitude type.
|
||||
-- @param #POINT_VEC3.RoutePointType Type The route point type.
|
||||
-- @param #POINT_VEC3.RoutePointAction Action The route point action.
|
||||
-- @param DCSTypes#Speed Speed Airspeed in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed Speed Airspeed in km/h.
|
||||
-- @param #boolean SpeedLocked true means the speed is locked.
|
||||
-- @return #table The route point.
|
||||
function POINT_VEC3:RoutePointAir( AltType, Type, Action, Speed, SpeedLocked )
|
||||
@ -440,7 +440,7 @@ end
|
||||
|
||||
--- Build an ground type route point.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Speed Speed Speed in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed Speed Speed in km/h.
|
||||
-- @param #POINT_VEC3.RoutePointAction Formation The route point Formation.
|
||||
-- @return #table The route point.
|
||||
function POINT_VEC3:RoutePointGround( Speed, Formation )
|
||||
@ -480,7 +480,7 @@ end
|
||||
|
||||
--- Smokes the point in a color.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param Utils#SMOKECOLOR SmokeColor
|
||||
-- @param Utilities.Utils#SMOKECOLOR SmokeColor
|
||||
function POINT_VEC3:Smoke( SmokeColor )
|
||||
self:F2( { SmokeColor } )
|
||||
trigger.action.smoke( self:GetVec3(), SmokeColor )
|
||||
@ -523,8 +523,8 @@ end
|
||||
|
||||
--- Flares the point in a color.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param Utils#FLARECOLOR FlareColor
|
||||
-- @param DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
-- @param Utilities.Utils#FLARECOLOR FlareColor
|
||||
-- @param Dcs.DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
function POINT_VEC3:Flare( FlareColor, Azimuth )
|
||||
self:F2( { FlareColor } )
|
||||
trigger.action.signalFlare( self:GetVec3(), FlareColor, Azimuth and Azimuth or 0 )
|
||||
@ -532,7 +532,7 @@ end
|
||||
|
||||
--- Flare the POINT_VEC3 White.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
-- @param Dcs.DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
function POINT_VEC3:FlareWhite( Azimuth )
|
||||
self:F2( Azimuth )
|
||||
self:Flare( FLARECOLOR.White, Azimuth )
|
||||
@ -540,7 +540,7 @@ end
|
||||
|
||||
--- Flare the POINT_VEC3 Yellow.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
-- @param Dcs.DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
function POINT_VEC3:FlareYellow( Azimuth )
|
||||
self:F2( Azimuth )
|
||||
self:Flare( FLARECOLOR.Yellow, Azimuth )
|
||||
@ -548,7 +548,7 @@ end
|
||||
|
||||
--- Flare the POINT_VEC3 Green.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
-- @param Dcs.DCSTypes#Azimuth (optional) Azimuth The azimuth of the flare direction. The default azimuth is 0.
|
||||
function POINT_VEC3:FlareGreen( Azimuth )
|
||||
self:F2( Azimuth )
|
||||
self:Flare( FLARECOLOR.Green, Azimuth )
|
||||
@ -569,10 +569,10 @@ do -- POINT_VEC2
|
||||
|
||||
--- POINT_VEC2 constructor.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
||||
-- @param DCSTypes#Distance y The y coordinate of the Vec3 point, pointing to the Right.
|
||||
-- @param DCSTypes#Distance LandHeightAdd (optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
|
||||
-- @return Point#POINT_VEC2
|
||||
-- @param Dcs.DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
||||
-- @param Dcs.DCSTypes#Distance y The y coordinate of the Vec3 point, pointing to the Right.
|
||||
-- @param Dcs.DCSTypes#Distance LandHeightAdd (optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
|
||||
-- @return Core.Point#POINT_VEC2
|
||||
function POINT_VEC2:New( x, y, LandHeightAdd )
|
||||
|
||||
local LandHeight = land.getHeight( { ["x"] = x, ["y"] = y } )
|
||||
@ -588,8 +588,8 @@ end
|
||||
|
||||
--- Create a new POINT_VEC2 object from Vec2 coordinates.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Vec2 Vec2 The Vec2 point.
|
||||
-- @return Point#POINT_VEC2 self
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The Vec2 point.
|
||||
-- @return Core.Point#POINT_VEC2 self
|
||||
function POINT_VEC2:NewFromVec2( Vec2, LandHeightAdd )
|
||||
|
||||
local LandHeight = land.getHeight( Vec2 )
|
||||
@ -605,8 +605,8 @@ end
|
||||
|
||||
--- Create a new POINT_VEC2 object from Vec3 coordinates.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Point#POINT_VEC2 self
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Core.Point#POINT_VEC2 self
|
||||
function POINT_VEC2:NewFromVec3( Vec3 )
|
||||
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
@ -658,7 +658,7 @@ end
|
||||
--- Calculate the distance from a reference @{#POINT_VEC2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #POINT_VEC2 PointVec2Reference The reference @{#POINT_VEC2}.
|
||||
-- @return DCSTypes#Distance The distance from the reference @{#POINT_VEC2} in meters.
|
||||
-- @return Dcs.DCSTypes#Distance The distance from the reference @{#POINT_VEC2} in meters.
|
||||
function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||
self:F2( PointVec2Reference )
|
||||
|
||||
@ -668,10 +668,10 @@ function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||
return Distance
|
||||
end
|
||||
|
||||
--- Calculate the distance from a reference @{DCSTypes#Vec2}.
|
||||
--- Calculate the distance from a reference @{Dcs.DCSTypes#Vec2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Vec2 Vec2Reference The reference @{DCSTypes#Vec2}.
|
||||
-- @return DCSTypes#Distance The distance from the reference @{DCSTypes#Vec2} in meters.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2Reference The reference @{Dcs.DCSTypes#Vec2}.
|
||||
-- @return Dcs.DCSTypes#Distance The distance from the reference @{Dcs.DCSTypes#Vec2} in meters.
|
||||
function POINT_VEC2:DistanceFromVec2( Vec2Reference )
|
||||
self:F2( Vec2Reference )
|
||||
|
||||
@ -691,8 +691,8 @@ end
|
||||
|
||||
--- Add a Distance in meters from the POINT_VEC2 orthonormal plane, with the given angle, and calculate the new POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Distance Distance The Distance to be added in meters.
|
||||
-- @param DCSTypes#Angle Angle The Angle in degrees.
|
||||
-- @param Dcs.DCSTypes#Distance Distance The Distance to be added in meters.
|
||||
-- @param Dcs.DCSTypes#Angle Angle The Angle in degrees.
|
||||
-- @return #POINT_VEC2 The new calculated POINT_VEC2.
|
||||
function POINT_VEC2:Translate( Distance, Angle )
|
||||
local SX = self:GetX()
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
--- This module contains the SCHEDULER class.
|
||||
--
|
||||
-- 1) @{Scheduler#SCHEDULER} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Scheduler#SCHEDULER} class, extends @{Core.Base#BASE}
|
||||
-- =====================================================
|
||||
-- The @{Scheduler#SCHEDULER} class models time events calling given event handling functions.
|
||||
-- The @{Core.Scheduler#SCHEDULER} class models time events calling given event handling functions.
|
||||
--
|
||||
-- 1.1) SCHEDULER constructor
|
||||
-- --------------------------
|
||||
-- The SCHEDULER class is quite easy to use:
|
||||
--
|
||||
-- * @{Scheduler#SCHEDULER.New}: Setup a new scheduler and start it with the specified parameters.
|
||||
-- * @{Core.Scheduler#SCHEDULER.New}: Setup a new scheduler and start it with the specified parameters.
|
||||
--
|
||||
-- 1.2) SCHEDULER timer stop and start
|
||||
-- -----------------------------------
|
||||
-- The SCHEDULER can be stopped and restarted with the following methods:
|
||||
--
|
||||
-- * @{Scheduler#SCHEDULER.Start}: (Re-)Start the scheduler.
|
||||
-- * @{Scheduler#SCHEDULER.Stop}: Stop the scheduler.
|
||||
-- * @{Core.Scheduler#SCHEDULER.Start}: (Re-)Start the scheduler.
|
||||
-- * @{Core.Scheduler#SCHEDULER.Stop}: Stop the scheduler.
|
||||
--
|
||||
-- 1.3) Reschedule new time event
|
||||
-- ------------------------------
|
||||
-- With @{Scheduler#SCHEDULER.Schedule} a new time event can be scheduled.
|
||||
-- With @{Core.Scheduler#SCHEDULER.Schedule} a new time event can be scheduled.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -39,7 +39,7 @@
|
||||
--- The SCHEDULER class
|
||||
-- @type SCHEDULER
|
||||
-- @field #number ScheduleID the ID of the scheduler.
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
SCHEDULER = {
|
||||
ClassName = "SCHEDULER",
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Set#SET_BASE} class, extends @{Core.Base#BASE}
|
||||
-- ==============================================
|
||||
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
|
||||
-- The @{Core.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 @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
|
||||
-- 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.
|
||||
--
|
||||
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
|
||||
-- Modify the iterator intervals with the @{Core.Set#SET_BASE.SetInteratorIntervals} method.
|
||||
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
|
||||
-- 2) @{Core.Set#SET_GROUP} class, extends @{Core.Set#SET_BASE}
|
||||
-- ==================================================
|
||||
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
|
||||
-- Mission designers can use the @{Core.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 @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
|
||||
-- GROUPS can be added and removed using the @{Core.Set#SET_GROUP.AddGroupsByName} and @{Core.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 @{Zone#ZONE}.
|
||||
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Core.Zone#ZONE}.
|
||||
--
|
||||
-- 2.4) SET_GROUP iterators:
|
||||
-- -------------------------
|
||||
@ -72,9 +72,9 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
|
||||
-- 3) @{Core.Set#SET_UNIT} class, extends @{Core.Set#SET_BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
|
||||
-- Mission designers can use the @{Core.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 @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
|
||||
-- UNITs can be added and removed using the @{Core.Set#SET_UNIT.AddUnitsByName} and @{Core.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 @{Zone#ZONE}.
|
||||
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Core.Zone#ZONE}.
|
||||
--
|
||||
-- 3.4) SET_UNIT iterators:
|
||||
-- ------------------------
|
||||
@ -130,9 +130,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
|
||||
-- 4) @{Core.Set#SET_CLIENT} class, extends @{Core.Set#SET_BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
|
||||
-- Mission designers can use the @{Core.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 @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
|
||||
-- CLIENTs can be added and removed using the @{Core.Set#SET_CLIENT.AddClientsByName} and @{Core.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 @{Zone#ZONE}.
|
||||
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Core.Zone#ZONE}.
|
||||
--
|
||||
-- 4.4) SET_CLIENT iterators:
|
||||
-- ------------------------
|
||||
@ -180,9 +180,9 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
|
||||
-- 5) @{Core.Set#SET_AIRBASE} class, extends @{Core.Set#SET_BASE}
|
||||
-- ====================================================
|
||||
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
|
||||
-- Mission designers can use the @{Core.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 @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
|
||||
-- AIRBASEs can be added and removed using the @{Core.Set#SET_AIRBASE.AddAirbasesByName} and @{Core.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
|
||||
@ -233,7 +233,7 @@
|
||||
-- @field #table Filter
|
||||
-- @field #table Set
|
||||
-- @field #table List
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
SET_BASE = {
|
||||
ClassName = "SET_BASE",
|
||||
Filter = {},
|
||||
@ -264,10 +264,10 @@ function SET_BASE:New( Database )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Finds an @{Base#BASE} object based on the object Name.
|
||||
--- Finds an @{Core.Base#BASE} object based on the object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @return Base#BASE The Object found.
|
||||
-- @return Core.Base#BASE The Object found.
|
||||
function SET_BASE:_Find( ObjectName )
|
||||
|
||||
local ObjectFound = self.Set[ObjectName]
|
||||
@ -284,11 +284,11 @@ function SET_BASE:GetSet()
|
||||
return self.Set
|
||||
end
|
||||
|
||||
--- Adds a @{Base#BASE} object in the @{Set#SET_BASE}, using a given ObjectName as the index.
|
||||
--- Adds a @{Core.Base#BASE} object in the @{Core.Set#SET_BASE}, using a given ObjectName as the index.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @param Base#BASE Object
|
||||
-- @return Base#BASE The added BASE Object.
|
||||
-- @param Core.Base#BASE Object
|
||||
-- @return Core.Base#BASE The added BASE Object.
|
||||
function SET_BASE:Add( ObjectName, Object )
|
||||
self:F2( ObjectName )
|
||||
|
||||
@ -310,10 +310,10 @@ function SET_BASE:Add( ObjectName, Object )
|
||||
|
||||
end
|
||||
|
||||
--- Adds a @{Base#BASE} object in the @{Set#SET_BASE}, using the Object Name as the index.
|
||||
--- Adds a @{Core.Base#BASE} object in the @{Core.Set#SET_BASE}, using the Object Name as the index.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Object#OBJECT Object
|
||||
-- @return Base#BASE The added BASE Object.
|
||||
-- @param Wrapper.Object#OBJECT Object
|
||||
-- @return Core.Base#BASE The added BASE Object.
|
||||
function SET_BASE:AddObject( Object )
|
||||
self:F2( Object.ObjectName )
|
||||
|
||||
@ -325,7 +325,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- Removes a @{Base#BASE} object from the @{Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
--- Removes a @{Core.Base#BASE} object from the @{Core.Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
function SET_BASE:Remove( ObjectName )
|
||||
@ -364,10 +364,10 @@ function SET_BASE:Remove( ObjectName )
|
||||
|
||||
end
|
||||
|
||||
--- Gets a @{Base#BASE} object from the @{Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
--- Gets a @{Core.Base#BASE} object from the @{Core.Set#SET_BASE} and derived classes, based on the Object Name.
|
||||
-- @param #SET_BASE self
|
||||
-- @param #string ObjectName
|
||||
-- @return Base#BASE
|
||||
-- @return Core.Base#BASE
|
||||
function SET_BASE:Get( ObjectName )
|
||||
self:F( ObjectName )
|
||||
|
||||
@ -379,7 +379,7 @@ function SET_BASE:Get( ObjectName )
|
||||
|
||||
end
|
||||
|
||||
--- Retrieves the amount of objects in the @{Set#SET_BASE} and derived classes.
|
||||
--- Retrieves the amount of objects in the @{Core.Set#SET_BASE} and derived classes.
|
||||
-- @param #SET_BASE self
|
||||
-- @return #number Count
|
||||
function SET_BASE:Count()
|
||||
@ -472,10 +472,10 @@ function SET_BASE:FilterStop()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_BASE while identifying the nearest object from a @{Point#POINT_VEC2}.
|
||||
--- Iterate the SET_BASE while identifying the nearest object from a @{Core.Point#POINT_VEC2}.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||
-- @return Base#BASE The closest object.
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.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 )
|
||||
|
||||
@ -526,7 +526,7 @@ end
|
||||
|
||||
--- Handles the OnBirth event for the Set.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnBirth( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
@ -542,7 +542,7 @@ end
|
||||
|
||||
--- Handles the OnDead or OnCrash event for alive units set.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnDeadOrCrash( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
@ -556,7 +556,7 @@ end
|
||||
|
||||
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
@ -572,7 +572,7 @@ end
|
||||
|
||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
@ -761,7 +761,7 @@ function SET_GROUP:New()
|
||||
end
|
||||
|
||||
--- Add GROUP(s) to SET_GROUP.
|
||||
-- @param Set#SET_GROUP self
|
||||
-- @param Core.Set#SET_GROUP self
|
||||
-- @param #string AddGroupNames A single name or an array of GROUP names.
|
||||
-- @return self
|
||||
function SET_GROUP:AddGroupsByName( AddGroupNames )
|
||||
@ -776,8 +776,8 @@ function SET_GROUP:AddGroupsByName( AddGroupNames )
|
||||
end
|
||||
|
||||
--- Remove GROUP(s) from SET_GROUP.
|
||||
-- @param Set#SET_GROUP self
|
||||
-- @param Group#GROUP RemoveGroupNames A single name or an array of GROUP names.
|
||||
-- @param Core.Set#SET_GROUP self
|
||||
-- @param Wrapper.Group#GROUP RemoveGroupNames A single name or an array of GROUP names.
|
||||
-- @return self
|
||||
function SET_GROUP:RemoveGroupsByName( RemoveGroupNames )
|
||||
|
||||
@ -796,7 +796,7 @@ end
|
||||
--- Finds a Group based on the Group Name.
|
||||
-- @param #SET_GROUP self
|
||||
-- @param #string GroupName
|
||||
-- @return Group#GROUP The found Group.
|
||||
-- @return Wrapper.Group#GROUP The found Group.
|
||||
function SET_GROUP:FindGroup( GroupName )
|
||||
|
||||
local GroupFound = self.Set[GroupName]
|
||||
@ -897,7 +897,7 @@ end
|
||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the GROUP
|
||||
-- @return #table The GROUP
|
||||
function SET_GROUP:AddInDatabase( Event )
|
||||
@ -914,7 +914,7 @@ end
|
||||
--- Handles the Database to check on any event that Object exists in the Database.
|
||||
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the GROUP
|
||||
-- @return #table The GROUP
|
||||
function SET_GROUP:FindInDatabase( Event )
|
||||
@ -937,7 +937,7 @@ end
|
||||
|
||||
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
|
||||
-- @return #SET_GROUP self
|
||||
function SET_GROUP:ForEachGroupCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -945,7 +945,7 @@ function SET_GROUP:ForEachGroupCompletelyInZone( ZoneObject, IteratorFunction, .
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Group#GROUP GroupObject
|
||||
-- @param Wrapper.Group#GROUP GroupObject
|
||||
function( ZoneObject, GroupObject )
|
||||
if GroupObject:IsCompletelyInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -959,7 +959,7 @@ end
|
||||
|
||||
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
|
||||
-- @return #SET_GROUP self
|
||||
function SET_GROUP:ForEachGroupPartlyInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -967,7 +967,7 @@ function SET_GROUP:ForEachGroupPartlyInZone( ZoneObject, IteratorFunction, ... )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Group#GROUP GroupObject
|
||||
-- @param Wrapper.Group#GROUP GroupObject
|
||||
function( ZoneObject, GroupObject )
|
||||
if GroupObject:IsPartlyInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -981,7 +981,7 @@ end
|
||||
|
||||
--- Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.
|
||||
-- @return #SET_GROUP self
|
||||
function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -989,7 +989,7 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Group#GROUP GroupObject
|
||||
-- @param Wrapper.Group#GROUP GroupObject
|
||||
function( ZoneObject, GroupObject )
|
||||
if GroupObject:IsNotInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -1030,7 +1030,7 @@ end
|
||||
|
||||
---
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Group#GROUP MooseGroup
|
||||
-- @param Wrapper.Group#GROUP MooseGroup
|
||||
-- @return #SET_GROUP self
|
||||
function SET_GROUP:IsIncludeObject( MooseGroup )
|
||||
self:F2( MooseGroup )
|
||||
@ -1086,7 +1086,7 @@ end
|
||||
|
||||
--- SET_UNIT class
|
||||
-- @type SET_UNIT
|
||||
-- @extends Set#SET_BASE
|
||||
-- @extends Core.Set#SET_BASE
|
||||
SET_UNIT = {
|
||||
ClassName = "SET_UNIT",
|
||||
Units = {},
|
||||
@ -1158,8 +1158,8 @@ function SET_UNIT:AddUnitsByName( AddUnitNames )
|
||||
end
|
||||
|
||||
--- Remove UNIT(s) from SET_UNIT.
|
||||
-- @param Set#SET_UNIT self
|
||||
-- @param Unit#UNIT RemoveUnitNames A single name or an array of UNIT names.
|
||||
-- @param Core.Set#SET_UNIT self
|
||||
-- @param Wrapper.Unit#UNIT RemoveUnitNames A single name or an array of UNIT names.
|
||||
-- @return self
|
||||
function SET_UNIT:RemoveUnitsByName( RemoveUnitNames )
|
||||
|
||||
@ -1176,7 +1176,7 @@ end
|
||||
--- Finds a Unit based on the Unit Name.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param #string UnitName
|
||||
-- @return Unit#UNIT The found Unit.
|
||||
-- @return Wrapper.Unit#UNIT The found Unit.
|
||||
function SET_UNIT:FindUnit( UnitName )
|
||||
|
||||
local UnitFound = self.Set[UnitName]
|
||||
@ -1322,7 +1322,7 @@ end
|
||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||
-- @param #SET_UNIT self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the UNIT
|
||||
-- @return #table The UNIT
|
||||
function SET_UNIT:AddInDatabase( Event )
|
||||
@ -1339,7 +1339,7 @@ end
|
||||
--- Handles the Database to check on any event that Object exists in the Database.
|
||||
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||
-- @param #SET_UNIT self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the UNIT
|
||||
-- @return #table The UNIT
|
||||
function SET_UNIT:FindInDatabase( Event )
|
||||
@ -1363,7 +1363,7 @@ end
|
||||
|
||||
--- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:ForEachUnitCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -1371,7 +1371,7 @@ function SET_UNIT:ForEachUnitCompletelyInZone( ZoneObject, IteratorFunction, ...
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Unit#UNIT UnitObject
|
||||
-- @param Wrapper.Unit#UNIT UnitObject
|
||||
function( ZoneObject, UnitObject )
|
||||
if UnitObject:IsCompletelyInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -1385,7 +1385,7 @@ end
|
||||
|
||||
--- Iterate the SET_UNIT and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -1393,7 +1393,7 @@ function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Unit#UNIT UnitObject
|
||||
-- @param Wrapper.Unit#UNIT UnitObject
|
||||
function( ZoneObject, UnitObject )
|
||||
if UnitObject:IsNotInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -1415,7 +1415,7 @@ function SET_UNIT:GetUnitTypes()
|
||||
local UnitTypes = {}
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetSet() ) do
|
||||
local TextUnit = UnitData -- Unit#UNIT
|
||||
local TextUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
if TextUnit:IsAlive() then
|
||||
local UnitType = TextUnit:GetTypeName()
|
||||
|
||||
@ -1460,7 +1460,7 @@ function SET_UNIT:GetUnitThreatLevels()
|
||||
local UnitThreatLevels = {}
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetSet() ) do
|
||||
local ThreatUnit = UnitData -- Unit#UNIT
|
||||
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
if ThreatUnit:IsAlive() then
|
||||
local UnitThreatLevel, UnitThreatLevelText = ThreatUnit:GetThreatLevel()
|
||||
local ThreatUnitName = ThreatUnit:GetName()
|
||||
@ -1477,14 +1477,14 @@ end
|
||||
|
||||
--- Returns if the @{Set} has targets having a radar (of a given type).
|
||||
-- @param #SET_UNIT self
|
||||
-- @param DCSUnit#Unit.RadarType RadarType
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit.RadarType RadarType
|
||||
-- @return #number The amount of radars in the Set with the given type
|
||||
function SET_UNIT:HasRadar( RadarType )
|
||||
self:F2( RadarType )
|
||||
|
||||
local RadarCount = 0
|
||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||
local UnitSensorTest = UnitData -- Unit#UNIT
|
||||
local UnitSensorTest = UnitData -- Wrapper.Unit#UNIT
|
||||
local HasSensors
|
||||
if RadarType then
|
||||
HasSensors = UnitSensorTest:HasSensors( Unit.SensorType.RADAR, RadarType )
|
||||
@ -1508,7 +1508,7 @@ function SET_UNIT:HasSEAD()
|
||||
|
||||
local SEADCount = 0
|
||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||
local UnitSEAD = UnitData -- Unit#UNIT
|
||||
local UnitSEAD = UnitData -- Wrapper.Unit#UNIT
|
||||
if UnitSEAD:IsAlive() then
|
||||
local UnitSEADAttributes = UnitSEAD:GetDesc().attributes
|
||||
|
||||
@ -1532,7 +1532,7 @@ function SET_UNIT:HasGroundUnits()
|
||||
|
||||
local GroundUnitCount = 0
|
||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||
local UnitTest = UnitData -- Unit#UNIT
|
||||
local UnitTest = UnitData -- Wrapper.Unit#UNIT
|
||||
if UnitTest:IsGround() then
|
||||
GroundUnitCount = GroundUnitCount + 1
|
||||
end
|
||||
@ -1549,7 +1549,7 @@ function SET_UNIT:HasFriendlyUnits( FriendlyCoalition )
|
||||
|
||||
local FriendlyUnitCount = 0
|
||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||
local UnitTest = UnitData -- Unit#UNIT
|
||||
local UnitTest = UnitData -- Wrapper.Unit#UNIT
|
||||
if UnitTest:IsFriendly( FriendlyCoalition ) then
|
||||
FriendlyUnitCount = FriendlyUnitCount + 1
|
||||
end
|
||||
@ -1588,7 +1588,7 @@ end
|
||||
|
||||
---
|
||||
-- @param #SET_UNIT self
|
||||
-- @param Unit#UNIT MUnit
|
||||
-- @param Wrapper.Unit#UNIT MUnit
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:IsIncludeObject( MUnit )
|
||||
self:F2( MUnit )
|
||||
@ -1681,7 +1681,7 @@ end
|
||||
|
||||
--- SET_CLIENT class
|
||||
-- @type SET_CLIENT
|
||||
-- @extends Set#SET_BASE
|
||||
-- @extends Core.Set#SET_BASE
|
||||
SET_CLIENT = {
|
||||
ClassName = "SET_CLIENT",
|
||||
Clients = {},
|
||||
@ -1723,7 +1723,7 @@ function SET_CLIENT:New()
|
||||
end
|
||||
|
||||
--- Add CLIENT(s) to SET_CLIENT.
|
||||
-- @param Set#SET_CLIENT self
|
||||
-- @param Core.Set#SET_CLIENT self
|
||||
-- @param #string AddClientNames A single name or an array of CLIENT names.
|
||||
-- @return self
|
||||
function SET_CLIENT:AddClientsByName( AddClientNames )
|
||||
@ -1738,8 +1738,8 @@ function SET_CLIENT:AddClientsByName( AddClientNames )
|
||||
end
|
||||
|
||||
--- Remove CLIENT(s) from SET_CLIENT.
|
||||
-- @param Set#SET_CLIENT self
|
||||
-- @param Client#CLIENT RemoveClientNames A single name or an array of CLIENT names.
|
||||
-- @param Core.Set#SET_CLIENT self
|
||||
-- @param Wrapper.Client#CLIENT RemoveClientNames A single name or an array of CLIENT names.
|
||||
-- @return self
|
||||
function SET_CLIENT:RemoveClientsByName( RemoveClientNames )
|
||||
|
||||
@ -1756,7 +1756,7 @@ end
|
||||
--- Finds a Client based on the Client Name.
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param #string ClientName
|
||||
-- @return Client#CLIENT The found Client.
|
||||
-- @return Wrapper.Client#CLIENT The found Client.
|
||||
function SET_CLIENT:FindClient( ClientName )
|
||||
|
||||
local ClientFound = self.Set[ClientName]
|
||||
@ -1877,7 +1877,7 @@ end
|
||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the CLIENT
|
||||
-- @return #table The CLIENT
|
||||
function SET_CLIENT:AddInDatabase( Event )
|
||||
@ -1889,7 +1889,7 @@ end
|
||||
--- Handles the Database to check on any event that Object exists in the Database.
|
||||
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the CLIENT
|
||||
-- @return #table The CLIENT
|
||||
function SET_CLIENT:FindInDatabase( Event )
|
||||
@ -1912,7 +1912,7 @@ end
|
||||
|
||||
--- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence completely in a @{Zone}, providing the CLIENT and optional parameters to the called function.
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter.
|
||||
-- @return #SET_CLIENT self
|
||||
function SET_CLIENT:ForEachClientInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -1920,7 +1920,7 @@ function SET_CLIENT:ForEachClientInZone( ZoneObject, IteratorFunction, ... )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Client#CLIENT ClientObject
|
||||
-- @param Wrapper.Client#CLIENT ClientObject
|
||||
function( ZoneObject, ClientObject )
|
||||
if ClientObject:IsInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -1934,7 +1934,7 @@ end
|
||||
|
||||
--- Iterate the SET_CLIENT and call an iterator function for each **alive** CLIENT presence not in a @{Zone}, providing the CLIENT and optional parameters to the called function.
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter.
|
||||
-- @return #SET_CLIENT self
|
||||
function SET_CLIENT:ForEachClientNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
@ -1942,7 +1942,7 @@ function SET_CLIENT:ForEachClientNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set,
|
||||
--- @param Zone#ZONE_BASE ZoneObject
|
||||
-- @param Client#CLIENT ClientObject
|
||||
-- @param Wrapper.Client#CLIENT ClientObject
|
||||
function( ZoneObject, ClientObject )
|
||||
if ClientObject:IsNotInZone( ZoneObject ) then
|
||||
return true
|
||||
@ -1956,7 +1956,7 @@ end
|
||||
|
||||
---
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param Client#CLIENT MClient
|
||||
-- @param Wrapper.Client#CLIENT MClient
|
||||
-- @return #SET_CLIENT self
|
||||
function SET_CLIENT:IsIncludeObject( MClient )
|
||||
self:F2( MClient )
|
||||
@ -2038,7 +2038,7 @@ end
|
||||
|
||||
--- SET_AIRBASE class
|
||||
-- @type SET_AIRBASE
|
||||
-- @extends Set#SET_BASE
|
||||
-- @extends Core.Set#SET_BASE
|
||||
SET_AIRBASE = {
|
||||
ClassName = "SET_AIRBASE",
|
||||
Airbases = {},
|
||||
@ -2074,7 +2074,7 @@ function SET_AIRBASE:New()
|
||||
end
|
||||
|
||||
--- Add AIRBASEs to SET_AIRBASE.
|
||||
-- @param Set#SET_AIRBASE self
|
||||
-- @param Core.Set#SET_AIRBASE self
|
||||
-- @param #string AddAirbaseNames A single name or an array of AIRBASE names.
|
||||
-- @return self
|
||||
function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
||||
@ -2089,8 +2089,8 @@ function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
||||
end
|
||||
|
||||
--- Remove AIRBASEs from SET_AIRBASE.
|
||||
-- @param Set#SET_AIRBASE self
|
||||
-- @param Airbase#AIRBASE RemoveAirbaseNames A single name or an array of AIRBASE names.
|
||||
-- @param Core.Set#SET_AIRBASE self
|
||||
-- @param Wrapper.Airbase#AIRBASE RemoveAirbaseNames A single name or an array of AIRBASE names.
|
||||
-- @return self
|
||||
function SET_AIRBASE:RemoveAirbasesByName( RemoveAirbaseNames )
|
||||
|
||||
@ -2107,7 +2107,7 @@ end
|
||||
--- Finds a Airbase based on the Airbase Name.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param #string AirbaseName
|
||||
-- @return Airbase#AIRBASE The found Airbase.
|
||||
-- @return Wrapper.Airbase#AIRBASE The found Airbase.
|
||||
function SET_AIRBASE:FindAirbase( AirbaseName )
|
||||
|
||||
local AirbaseFound = self.Set[AirbaseName]
|
||||
@ -2169,7 +2169,7 @@ end
|
||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the AIRBASE
|
||||
-- @return #table The AIRBASE
|
||||
function SET_AIRBASE:AddInDatabase( Event )
|
||||
@ -2181,7 +2181,7 @@ end
|
||||
--- Handles the Database to check on any event that Object exists in the Database.
|
||||
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #string The name of the AIRBASE
|
||||
-- @return #table The AIRBASE
|
||||
function SET_AIRBASE:FindInDatabase( Event )
|
||||
@ -2202,10 +2202,10 @@ function SET_AIRBASE:ForEachAirbase( IteratorFunction, ... )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Airbase#AIRBASE} from a @{Point#POINT_VEC2}.
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Wrapper.Airbase#AIRBASE} from a @{Core.Point#POINT_VEC2}.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest @{Airbase#AIRBASE}.
|
||||
-- @return Airbase#AIRBASE The closest @{Airbase#AIRBASE}.
|
||||
-- @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}.
|
||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
self:F2( PointVec2 )
|
||||
|
||||
@ -2217,7 +2217,7 @@ end
|
||||
|
||||
---
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Airbase#AIRBASE MAirbase
|
||||
-- @param Wrapper.Airbase#AIRBASE MAirbase
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:IsIncludeObject( MAirbase )
|
||||
self:F2( MAirbase )
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- This module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
|
||||
--- This module contains the ZONE classes, inherited from @{Core.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 @{Group#GROUP} objects).
|
||||
-- * Test if partly within the zone (for @{Wrapper.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:
|
||||
--
|
||||
-- * @{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.
|
||||
-- * @{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.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Zone#ZONE_BASE} class, extends @{Base#BASE}
|
||||
-- 1) @{Core.Zone#ZONE_BASE} class, extends @{Core.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 @{Zone#ZONE_BASE}:
|
||||
-- ### 1.2) Each zone implements two polymorphic functions defined in @{Core.Zone#ZONE_BASE}:
|
||||
--
|
||||
-- * @{#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.
|
||||
-- * @{#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.
|
||||
--
|
||||
-- ### 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 @{DCSTypes#Vec2} coordinate of the zone.
|
||||
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{DCSTypes#Vec2} within the zone.
|
||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
--
|
||||
-- ### 1.5) A zone has a bounding square:
|
||||
--
|
||||
@ -59,12 +59,12 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Zone#ZONE_RADIUS} class, extends @{Zone#ZONE_BASE}
|
||||
-- 2) @{Core.Zone#ZONE_RADIUS} class, extends @{Core.Zone#ZONE_BASE}
|
||||
-- =======================================================
|
||||
-- The ZONE_RADIUS class defined by a zone name, a location and a radius.
|
||||
-- This class implements the inherited functions from Zone#ZONE_BASE taking into account the own zone format and properties.
|
||||
-- This class implements the inherited functions from Core.Zone#ZONE_BASE taking into account the own zone format and properties.
|
||||
--
|
||||
-- ### 2.1) @{Zone#ZONE_RADIUS} constructor:
|
||||
-- ### 2.1) @{Core.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 @{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.
|
||||
-- * @{#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.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 3) @{Zone#ZONE} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- 3) @{Core.Zone#ZONE} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- ==========================================
|
||||
-- The ZONE class, defined by the zone name as defined within the Mission Editor.
|
||||
-- This class implements the inherited functions from {Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
-- This class implements the inherited functions from {Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 4) @{Zone#ZONE_UNIT} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- 4) @{Core.Zone#ZONE_UNIT} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- =======================================================
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 5) @{Zone#ZONE_GROUP} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- 5) @{Core.Zone#ZONE_GROUP} class, extends @{Core.Zone#ZONE_RADIUS}
|
||||
-- =======================================================
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 6) @{Zone#ZONE_POLYGON_BASE} class, extends @{Zone#ZONE_BASE}
|
||||
-- 6) @{Core.Zone#ZONE_POLYGON_BASE} class, extends @{Core.Zone#ZONE_BASE}
|
||||
-- ========================================================
|
||||
-- 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.
|
||||
-- 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.
|
||||
-- This class is an abstract BASE class for derived classes, and is not meant to be instantiated.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 7) @{Zone#ZONE_POLYGON} class, extends @{Zone#ZONE_POLYGON_BASE}
|
||||
-- 7) @{Core.Zone#ZONE_POLYGON} class, extends @{Core.Zone#ZONE_POLYGON_BASE}
|
||||
-- ================================================================
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
@ -145,7 +145,7 @@
|
||||
-- @type ZONE_BASE
|
||||
-- @field #string ZoneName Name of the zone.
|
||||
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
ZONE_BASE = {
|
||||
ClassName = "ZONE_BASE",
|
||||
ZoneName = "",
|
||||
@ -155,10 +155,10 @@ ZONE_BASE = {
|
||||
|
||||
--- The ZONE_BASE.BoundingSquare
|
||||
-- @type ZONE_BASE.BoundingSquare
|
||||
-- @field DCSTypes#Distance x1 The lower x coordinate (left down)
|
||||
-- @field DCSTypes#Distance y1 The lower y coordinate (left down)
|
||||
-- @field DCSTypes#Distance x2 The higher x coordinate (right up)
|
||||
-- @field DCSTypes#Distance y2 The higher y coordinate (right up)
|
||||
-- @field Dcs.DCSTypes#Distance x1 The lower x coordinate (left down)
|
||||
-- @field Dcs.DCSTypes#Distance y1 The lower y coordinate (left down)
|
||||
-- @field Dcs.DCSTypes#Distance x2 The higher x coordinate (right up)
|
||||
-- @field Dcs.DCSTypes#Distance y2 The higher y coordinate (right up)
|
||||
|
||||
|
||||
--- ZONE_BASE constructor
|
||||
@ -184,7 +184,7 @@ function ZONE_BASE:GetName()
|
||||
end
|
||||
--- Returns if a location is within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @return #boolean true if the location is within the zone.
|
||||
function ZONE_BASE:IsPointVec2InZone( Vec2 )
|
||||
self:F2( Vec2 )
|
||||
@ -194,7 +194,7 @@ end
|
||||
|
||||
--- Returns if a point is within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCSTypes#Vec3 Vec3 The point to test.
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The point to test.
|
||||
-- @return #boolean true if the point is within the zone.
|
||||
function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
||||
self:F2( Vec3 )
|
||||
@ -204,7 +204,7 @@ function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
||||
return InZone
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec2} coordinate of the zone.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return #nil.
|
||||
function ZONE_BASE:GetVec2()
|
||||
@ -212,9 +212,9 @@ function ZONE_BASE:GetVec2()
|
||||
|
||||
return nil
|
||||
end
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return DCSTypes#Vec2 The Vec2 coordinates.
|
||||
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinates.
|
||||
function ZONE_BASE:GetRandomVec2()
|
||||
return nil
|
||||
end
|
||||
@ -273,9 +273,9 @@ end
|
||||
|
||||
--- The ZONE_RADIUS class, defined by a zone name, a location and a radius.
|
||||
-- @type ZONE_RADIUS
|
||||
-- @field DCSTypes#Vec2 Vec2 The current location of the zone.
|
||||
-- @field DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @extends Zone#ZONE_BASE
|
||||
-- @field Dcs.DCSTypes#Vec2 Vec2 The current location of the zone.
|
||||
-- @field Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @extends Core.Zone#ZONE_BASE
|
||||
ZONE_RADIUS = {
|
||||
ClassName="ZONE_RADIUS",
|
||||
}
|
||||
@ -283,8 +283,8 @@ ZONE_RADIUS = {
|
||||
--- Constructor of @{#ZONE_RADIUS}, taking the zone name, the zone location and a radius.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param DCSTypes#Vec2 Vec2 The location of the zone.
|
||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The location of the zone.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @return #ZONE_RADIUS self
|
||||
function ZONE_RADIUS:New( ZoneName, Vec2, Radius )
|
||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
||||
@ -325,9 +325,9 @@ end
|
||||
|
||||
--- Flares the zone boundaries in a color.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param Utils#FLARECOLOR FlareColor The flare color.
|
||||
-- @param Utilities.Utils#FLARECOLOR FlareColor The flare color.
|
||||
-- @param #number Points (optional) The amount of points in the circle.
|
||||
-- @param DCSTypes#Azimuth Azimuth (optional) Azimuth The azimuth of the flare.
|
||||
-- @param Dcs.DCSTypes#Azimuth Azimuth (optional) Azimuth The azimuth of the flare.
|
||||
-- @return #ZONE_RADIUS self
|
||||
function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth )
|
||||
self:F2( { FlareColor, Azimuth } )
|
||||
@ -352,7 +352,7 @@ end
|
||||
|
||||
--- Returns the radius of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return DCSTypes#Distance The radius of the zone.
|
||||
-- @return Dcs.DCSTypes#Distance The radius of the zone.
|
||||
function ZONE_RADIUS:GetRadius()
|
||||
self:F2( self.ZoneName )
|
||||
|
||||
@ -363,8 +363,8 @@ end
|
||||
|
||||
--- Sets the radius of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @return DCSTypes#Distance The radius of the zone.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @return Dcs.DCSTypes#Distance The radius of the zone.
|
||||
function ZONE_RADIUS:SetRadius( Radius )
|
||||
self:F2( self.ZoneName )
|
||||
|
||||
@ -374,9 +374,9 @@ function ZONE_RADIUS:SetRadius( Radius )
|
||||
return self.Radius
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec2} of the zone.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return DCSTypes#Vec2 The location of the zone.
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone.
|
||||
function ZONE_RADIUS:GetVec2()
|
||||
self:F2( self.ZoneName )
|
||||
|
||||
@ -385,10 +385,10 @@ function ZONE_RADIUS:GetVec2()
|
||||
return self.Vec2
|
||||
end
|
||||
|
||||
--- Sets the @{DCSTypes#Vec2} of the zone.
|
||||
--- Sets the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param DCSTypes#Vec2 Vec2 The new location of the zone.
|
||||
-- @return DCSTypes#Vec2 The new location of the zone.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The new location of the zone.
|
||||
-- @return Dcs.DCSTypes#Vec2 The new location of the zone.
|
||||
function ZONE_RADIUS:SetVec2( Vec2 )
|
||||
self:F2( self.ZoneName )
|
||||
|
||||
@ -399,10 +399,10 @@ function ZONE_RADIUS:SetVec2( Vec2 )
|
||||
return self.Vec2
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_RADIUS.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_RADIUS.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return DCSTypes#Vec3 The point of the zone.
|
||||
-- @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.
|
||||
function ZONE_RADIUS:GetVec3( Height )
|
||||
self:F2( { self.ZoneName, Height } )
|
||||
|
||||
@ -419,7 +419,7 @@ end
|
||||
|
||||
--- Returns if a location is within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @return #boolean true if the location is within the zone.
|
||||
function ZONE_RADIUS:IsPointVec2InZone( Vec2 )
|
||||
self:F2( Vec2 )
|
||||
@ -437,7 +437,7 @@ end
|
||||
|
||||
--- Returns if a point is within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param DCSTypes#Vec3 Vec3 The point to test.
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The point to test.
|
||||
-- @return #boolean true if the point is within the zone.
|
||||
function ZONE_RADIUS:IsPointVec3InZone( Vec3 )
|
||||
self:F2( Vec3 )
|
||||
@ -449,7 +449,7 @@ end
|
||||
|
||||
--- Returns a random location within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return DCSTypes#Vec2 The random location within the zone.
|
||||
-- @return Dcs.DCSTypes#Vec2 The random location within the zone.
|
||||
function ZONE_RADIUS:GetRandomVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@ -469,7 +469,7 @@ end
|
||||
|
||||
--- The ZONE class, defined by the zone name as defined within the Mission Editor. The location and the radius are automatically collected from the mission settings.
|
||||
-- @type ZONE
|
||||
-- @extends Zone#ZONE_RADIUS
|
||||
-- @extends Core.Zone#ZONE_RADIUS
|
||||
ZONE = {
|
||||
ClassName="ZONE",
|
||||
}
|
||||
@ -497,10 +497,10 @@ function ZONE:New( ZoneName )
|
||||
end
|
||||
|
||||
|
||||
--- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
|
||||
--- The ZONE_UNIT class defined by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||
-- @type ZONE_UNIT
|
||||
-- @field Unit#UNIT ZoneUNIT
|
||||
-- @extends Zone#ZONE_RADIUS
|
||||
-- @field Wrapper.Unit#UNIT ZoneUNIT
|
||||
-- @extends Core.Zone#ZONE_RADIUS
|
||||
ZONE_UNIT = {
|
||||
ClassName="ZONE_UNIT",
|
||||
}
|
||||
@ -508,8 +508,8 @@ ZONE_UNIT = {
|
||||
--- Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param Unit#UNIT ZoneUNIT The unit as the center of the zone.
|
||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @param Wrapper.Unit#UNIT ZoneUNIT The unit as the center of the zone.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @return #ZONE_UNIT self
|
||||
function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
|
||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneUNIT:GetVec2(), Radius ) )
|
||||
@ -522,9 +522,9 @@ function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
|
||||
end
|
||||
|
||||
|
||||
--- Returns the current location of the @{Unit#UNIT}.
|
||||
--- Returns the current location of the @{Wrapper.Unit#UNIT}.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @return DCSTypes#Vec2 The location of the zone based on the @{Unit#UNIT}location.
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone based on the @{Wrapper.Unit#UNIT}location.
|
||||
function ZONE_UNIT:GetVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@ -543,7 +543,7 @@ end
|
||||
|
||||
--- Returns a random location within the zone.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @return DCSTypes#Vec2 The random location within the zone.
|
||||
-- @return Dcs.DCSTypes#Vec2 The random location within the zone.
|
||||
function ZONE_UNIT:GetRandomVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@ -563,10 +563,10 @@ function ZONE_UNIT:GetRandomVec2()
|
||||
return RandomVec2
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_UNIT.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_UNIT.
|
||||
-- @param #ZONE_UNIT self
|
||||
-- @param DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return DCSTypes#Vec3 The point of the zone.
|
||||
-- @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.
|
||||
function ZONE_UNIT:GetVec3( Height )
|
||||
self:F2( self.ZoneName )
|
||||
|
||||
@ -583,17 +583,17 @@ end
|
||||
|
||||
--- The ZONE_GROUP class defined by a zone around a @{Group}, taking the average center point of all the units within the Group, with a radius.
|
||||
-- @type ZONE_GROUP
|
||||
-- @field Group#GROUP ZoneGROUP
|
||||
-- @extends Zone#ZONE_RADIUS
|
||||
-- @field Wrapper.Group#GROUP ZoneGROUP
|
||||
-- @extends Core.Zone#ZONE_RADIUS
|
||||
ZONE_GROUP = {
|
||||
ClassName="ZONE_GROUP",
|
||||
}
|
||||
|
||||
--- Constructor to create a ZONE_GROUP instance, taking the zone name, a zone @{Group#GROUP} and a radius.
|
||||
--- Constructor to create a ZONE_GROUP instance, taking the zone name, a zone @{Wrapper.Group#GROUP} and a radius.
|
||||
-- @param #ZONE_GROUP self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param Group#GROUP ZoneGROUP The @{Group} as the center of the zone.
|
||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @param Wrapper.Group#GROUP ZoneGROUP The @{Group} as the center of the zone.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||
-- @return #ZONE_GROUP self
|
||||
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius ) )
|
||||
@ -607,7 +607,7 @@ end
|
||||
|
||||
--- Returns the current location of the @{Group}.
|
||||
-- @param #ZONE_GROUP self
|
||||
-- @return DCSTypes#Vec2 The location of the zone based on the @{Group} location.
|
||||
-- @return Dcs.DCSTypes#Vec2 The location of the zone based on the @{Group} location.
|
||||
function ZONE_GROUP:GetVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@ -620,7 +620,7 @@ end
|
||||
|
||||
--- Returns a random location within the zone of the @{Group}.
|
||||
-- @param #ZONE_GROUP self
|
||||
-- @return DCSTypes#Vec2 The random location of the zone based on the @{Group} location.
|
||||
-- @return Dcs.DCSTypes#Vec2 The random location of the zone based on the @{Group} location.
|
||||
function ZONE_GROUP:GetRandomVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
@ -640,23 +640,23 @@ end
|
||||
|
||||
-- Polygons
|
||||
|
||||
--- The ZONE_POLYGON_BASE class defined by an array of @{DCSTypes#Vec2}, forming a polygon.
|
||||
--- The ZONE_POLYGON_BASE class defined by an array of @{Dcs.DCSTypes#Vec2}, forming a polygon.
|
||||
-- @type ZONE_POLYGON_BASE
|
||||
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{DCSTypes#Vec2}.
|
||||
-- @extends Zone#ZONE_BASE
|
||||
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{Dcs.DCSTypes#Vec2}.
|
||||
-- @extends Core.Zone#ZONE_BASE
|
||||
ZONE_POLYGON_BASE = {
|
||||
ClassName="ZONE_POLYGON_BASE",
|
||||
}
|
||||
|
||||
--- A points array.
|
||||
-- @type ZONE_POLYGON_BASE.ListVec2
|
||||
-- @list <DCSTypes#Vec2>
|
||||
-- @list <Dcs.DCSTypes#Vec2>
|
||||
|
||||
--- 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.
|
||||
--- 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.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param #ZONE_POLYGON_BASE.ListVec2 PointsArray An array of @{DCSTypes#Vec2}, forming a polygon..
|
||||
-- @param #ZONE_POLYGON_BASE.ListVec2 PointsArray An array of @{Dcs.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 ) )
|
||||
@ -725,7 +725,7 @@ end
|
||||
--- Returns if a location is within the zone.
|
||||
-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @param DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The location to test.
|
||||
-- @return #boolean true if the location is within the zone.
|
||||
function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
||||
self:F2( Vec2 )
|
||||
@ -753,9 +753,9 @@ function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
||||
return InPolygon
|
||||
end
|
||||
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return DCSTypes#Vec2 The Vec2 coordinate.
|
||||
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinate.
|
||||
function ZONE_POLYGON_BASE:GetRandomVec2()
|
||||
self:F2()
|
||||
|
||||
@ -805,18 +805,18 @@ end
|
||||
|
||||
|
||||
|
||||
--- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
--- The ZONE_POLYGON class defined by a sequence of @{Wrapper.Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
-- @type ZONE_POLYGON
|
||||
-- @extends Zone#ZONE_POLYGON_BASE
|
||||
-- @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 @{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.
|
||||
--- 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.
|
||||
-- @param #ZONE_POLYGON self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
-- @param Group#GROUP ZoneGroup The GROUP waypoints as defined within the Mission Editor define the polygon shape.
|
||||
-- @param Wrapper.Group#GROUP ZoneGroup The GROUP waypoints as defined within the Mission Editor define the polygon shape.
|
||||
-- @return #ZONE_POLYGON self
|
||||
function ZONE_POLYGON:New( ZoneName, ZoneGroup )
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
--- Represents airbases: airdromes, helipads and ships with flying decks or landing pads.
|
||||
-- @type Airbase
|
||||
-- @extends DCSCoalitionObject#CoalitionObject
|
||||
-- @extends Dcs.DCSCoalitionWrapper.Object#CoalitionObject
|
||||
-- @field #Airbase.ID ID Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.
|
||||
-- @field #Airbase.Category Category enum contains identifiers of airbase categories.
|
||||
-- @field #Airbase.Desc Desc Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.
|
||||
@ -33,7 +33,7 @@
|
||||
--- Returns Unit that is corresponded to the airbase. Works only for ships.
|
||||
-- @function [parent=#Airbase] getUnit
|
||||
-- @param self
|
||||
-- @return Unit#Unit
|
||||
-- @return Wrapper.Unit#Unit
|
||||
|
||||
--- Returns identifier of the airbase.
|
||||
-- @function [parent=#Airbase] getID
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
-- @module DCSCoalitionObject
|
||||
|
||||
--- @type CoalitionObject
|
||||
-- @extends DCSObject#Object
|
||||
-- @extends Dcs.DCSWrapper.Object#Object
|
||||
|
||||
--- @type coalition
|
||||
-- @field #coalition.side side
|
||||
@ -17,7 +17,7 @@ coalition = {} --#coalition
|
||||
--- Returns coalition of the object.
|
||||
-- @function [parent=#CoalitionObject] getCoalition
|
||||
-- @param #CoalitionObject self
|
||||
-- @return DCSTypes#coalition.side
|
||||
-- @return Dcs.DCSTypes#coalition.side
|
||||
|
||||
--- Returns object country.
|
||||
-- @function [parent=#CoalitionObject] getCountry
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
--- Detected target.
|
||||
-- @type DetectedTarget
|
||||
-- @field Object#Object object The target
|
||||
-- @field Wrapper.Object#Object object The target
|
||||
-- @field #boolean visible The target is visible
|
||||
-- @field #boolean type The target type is known
|
||||
-- @field #boolean distance Distance to the target is known
|
||||
@ -87,7 +87,7 @@
|
||||
--- Checks if the target is detected or not. If one or more detection method is specified the function will return true if the target is detected by at least one of these methods. If no detection methods are specified the function will return true if the target is detected by any method.
|
||||
-- @function [parent=#Controller] isTargetDetected
|
||||
-- @param self
|
||||
-- @param Object#Object target Target to check
|
||||
-- @param Wrapper.Object#Object target Target to check
|
||||
-- @param #Controller.Detection detection Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
|
||||
-- @return #boolean detected True if the target is detected.
|
||||
-- @return #boolean visible Has effect only if detected is true. True if the target is visible now.
|
||||
@ -107,7 +107,7 @@
|
||||
--- Know a target.
|
||||
-- @function [parent=#Controller] knowTarget
|
||||
-- @param self
|
||||
-- @param Object#Object object The target.
|
||||
-- @param Wrapper.Object#Object object The target.
|
||||
-- @param #boolean type Target type is known.
|
||||
-- @param #boolean distance Distance to target is known.
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
--- Returns the coalition of the group.
|
||||
-- @function [parent=#Group] getCoalition
|
||||
-- @param #Group self
|
||||
-- @return DCSCoalitionObject#coalition.side
|
||||
-- @return Dcs.DCSCoalitionWrapper.Object#coalition.side
|
||||
|
||||
--- Returns the group's name. This is the same name assigned to the group in Mission Editor.
|
||||
-- @function [parent=#Group] getName
|
||||
@ -57,7 +57,7 @@
|
||||
-- @function [parent=#Group] getUnit
|
||||
-- @param #Group self
|
||||
-- @param #number unitNumber
|
||||
-- @return DCSUnit#Unit
|
||||
-- @return Dcs.DCSWrapper.Unit#Unit
|
||||
|
||||
--- Returns current size of the group. If some of the units will be destroyed, As units are destroyed the size of the group will be changed.
|
||||
-- @function [parent=#Group] getSize
|
||||
@ -72,7 +72,7 @@
|
||||
--- Returns array of the units present in the group now. Destroyed units will not be enlisted at all.
|
||||
-- @function [parent=#Group] getUnits
|
||||
-- @param #Group self
|
||||
-- @return #list<DCSUnit#Unit> array of Units
|
||||
-- @return #list<Dcs.DCSWrapper.Unit#Unit> array of Units
|
||||
|
||||
--- Returns controller of the group.
|
||||
-- @function [parent=#Group] getController
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- @module StaticObject
|
||||
-- @extends CoalitionObject#CoalitionObject
|
||||
-- @extends CoalitionWrapper.Object#CoalitionObject
|
||||
|
||||
--- Represents static object added in the Mission Editor.
|
||||
-- @type StaticObject
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
--- StaticObject descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.
|
||||
-- @type StaticObject.Desc
|
||||
-- @extends Unit#Unit.Desc
|
||||
-- @extends Wrapper.Unit#Unit.Desc
|
||||
|
||||
--- Returns static object by its name. If no static object found nil will be returned.
|
||||
-- @function [parent=#StaticObject] getByName
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
-- @module DCSUnit
|
||||
|
||||
--- @type Unit
|
||||
-- @extends DCSCoalitionObject#CoalitionObject
|
||||
-- @extends Dcs.DCSCoalitionWrapper.Object#CoalitionObject
|
||||
-- @field ID Identifier of an unit. It assigned to an unit by the Mission Editor automatically.
|
||||
-- @field #Unit.Category Category
|
||||
-- @field #Unit.RefuelingSystem RefuelingSystem
|
||||
@ -57,14 +57,14 @@
|
||||
|
||||
--- A unit descriptor.
|
||||
-- @type Unit.Desc
|
||||
-- @extends Object#Object.Desc
|
||||
-- @extends Wrapper.Object#Object.Desc
|
||||
-- @field #Unit.Category category Unit Category
|
||||
-- @field #Mass massEmpty mass of empty unit
|
||||
-- @field #number speedMax istance / Time, --maximal velocity
|
||||
|
||||
--- An aircraft descriptor.
|
||||
-- @type Unit.DescAircraft
|
||||
-- @extends Unit#Unit.Desc
|
||||
-- @extends Wrapper.Unit#Unit.Desc
|
||||
-- @field #Mass fuelMassMax maximal inner fuel mass
|
||||
-- @field #Distance range Operational range
|
||||
-- @field #Distance Hmax Ceiling
|
||||
@ -75,18 +75,18 @@
|
||||
|
||||
--- An airplane descriptor.
|
||||
-- @type Unit.DescAirplane
|
||||
-- @extends Unit#Unit.DescAircraft
|
||||
-- @extends Wrapper.Unit#Unit.DescAircraft
|
||||
-- @field #number speedMax0 Distance / Time maximal TAS at ground level
|
||||
-- @field #number speedMax10K Distance / Time maximal TAS at altitude of 10 km
|
||||
|
||||
--- A helicopter descriptor.
|
||||
-- @type Unit.DescHelicopter
|
||||
-- @extends Unit#Unit.DescAircraft
|
||||
-- @extends Wrapper.Unit#Unit.DescAircraft
|
||||
-- @field #Distance HmaxStat static ceiling
|
||||
|
||||
--- A vehicle descriptor.
|
||||
-- @type Unit.DescVehicle
|
||||
-- @extends Unit#Unit.Desc
|
||||
-- @extends Wrapper.Unit#Unit.Desc
|
||||
-- @field #Angle maxSlopeAngle maximal slope angle
|
||||
-- @field #boolean riverCrossing can the vehicle cross a rivers
|
||||
|
||||
@ -106,12 +106,12 @@
|
||||
|
||||
--- An optic sensor.
|
||||
-- @type Unit.Optic
|
||||
-- @extends Unit#Unit.Sensor
|
||||
-- @extends Wrapper.Unit#Unit.Sensor
|
||||
-- @field #Unit.OpticType opticType
|
||||
|
||||
--- A radar.
|
||||
-- @type Unit.Radar
|
||||
-- @extends Unit#Unit.Sensor
|
||||
-- @extends Wrapper.Unit#Unit.Sensor
|
||||
-- @field #Distance detectionDistanceRBM detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search
|
||||
-- @field #Distance detectionDistanceHRM detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM
|
||||
-- @field #Unit.Radar.detectionDistanceAir detectionDistanceAir detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search
|
||||
@ -129,7 +129,7 @@
|
||||
-- @field #Distance tailOn
|
||||
|
||||
--- An IRST.
|
||||
-- @type Unit#Unit.IRST
|
||||
-- @type Wrapper.Unit#Unit.IRST
|
||||
-- @extends Unit.Sensor
|
||||
-- @field #Distance detectionDistanceIdle detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle
|
||||
-- @field #Distance detectionDistanceMaximal ..., engines are in maximal mode
|
||||
@ -137,7 +137,7 @@
|
||||
|
||||
--- An RWR.
|
||||
-- @type Unit.RWR
|
||||
-- @extends Unit#Unit.Sensor
|
||||
-- @extends Wrapper.Unit#Unit.Sensor
|
||||
|
||||
--- table that stores all unit sensors.
|
||||
-- TODO @type Sensors
|
||||
@ -178,7 +178,7 @@
|
||||
--- Returns the unit's group if it exist and nil otherwise
|
||||
-- @function [parent=#Unit] getGroup
|
||||
-- @param #Unit self
|
||||
-- @return DCSGroup#Group
|
||||
-- @return Dcs.DCSWrapper.Group#Group
|
||||
|
||||
--- Returns the unit's callsign - the localized string.
|
||||
-- @function [parent=#Unit] getCallsign
|
||||
@ -230,7 +230,7 @@
|
||||
-- Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.
|
||||
-- @function [parent=#Unit] getRadar
|
||||
-- @param #Unit self
|
||||
-- @return #boolean, Object#Object
|
||||
-- @return #boolean, Wrapper.Object#Object
|
||||
|
||||
--- Returns unit descriptor. Descriptor type depends on unit category.
|
||||
-- @function [parent=#Unit] getDesc
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
--- Returns altitude MSL of the point.
|
||||
-- @function [parent=#land] getHeight
|
||||
-- @param #Vec2 point point on the ground.
|
||||
-- @return DCSTypes#Distance
|
||||
-- @return Dcs.DCSTypes#Distance
|
||||
|
||||
--- returns surface type at the given point.
|
||||
-- @function [parent=#land] getSurfaceType
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
||||
-- These state transition methods need to provide a return value, which is specified at the function description.
|
||||
--
|
||||
-- # 1) @{#PROCESS_ACCOUNT_DEADS} FSM class, extends @{Account#PROCESS_ACCOUNT}
|
||||
-- # 1) @{#PROCESS_ACCOUNT_DEADS} FSM class, extends @{Fsm.Account#PROCESS_ACCOUNT}
|
||||
--
|
||||
-- The PROCESS_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.
|
||||
-- The process is given a @{Set} of units that will be tracked upon successful destruction.
|
||||
@ -77,7 +77,7 @@ do -- PROCESS_ACCOUNT
|
||||
--- PROCESS_ACCOUNT class
|
||||
-- @type PROCESS_ACCOUNT
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||
PROCESS_ACCOUNT = {
|
||||
ClassName = "PROCESS_ACCOUNT",
|
||||
TargetSetUnit = nil,
|
||||
@ -89,7 +89,7 @@ do -- PROCESS_ACCOUNT
|
||||
function PROCESS_ACCOUNT:New()
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_TEMPLATE:New( "PROCESS_ACCOUNT" ) ) -- Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
local self = BASE:Inherit( self, FSM_TEMPLATE:New( "PROCESS_ACCOUNT" ) ) -- Core.StateMachine#FSM_TEMPLATE
|
||||
|
||||
self:AddTransition( "Assigned", "Start", "Waiting")
|
||||
self:AddTransition( "*", "Wait", "Waiting")
|
||||
@ -111,7 +111,7 @@ do -- PROCESS_ACCOUNT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ACCOUNT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -125,7 +125,7 @@ do -- PROCESS_ACCOUNT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ACCOUNT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -143,7 +143,7 @@ do -- PROCESS_ACCOUNT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ACCOUNT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -199,7 +199,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -213,7 +213,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -233,7 +233,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -54,7 +54,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#PROCESS_ASSIGN_ACCEPT} class, extends @{Assign#PROCESS_ASSIGN}
|
||||
-- # 1) @{#PROCESS_ASSIGN_ACCEPT} class, extends @{Fsm.Assign#PROCESS_ASSIGN}
|
||||
--
|
||||
-- The PROCESS_ASSIGN_ACCEPT class accepts by default a task for a player. No player intervention is allowed to reject the task.
|
||||
--
|
||||
@ -64,7 +64,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 2) @{#PROCESS_ASSIGN_MENU_ACCEPT} class, extends @{Assign#PROCESS_ASSIGN}
|
||||
-- # 2) @{#PROCESS_ASSIGN_MENU_ACCEPT} class, extends @{Fsm.Assign#PROCESS_ASSIGN}
|
||||
--
|
||||
-- The PROCESS_ASSIGN_MENU_ACCEPT class accepts a task when the player accepts the task through an added menu option.
|
||||
-- This assignment type is useful to conditionally allow the player to choose whether or not he would accept the task.
|
||||
@ -85,9 +85,9 @@ do -- PROCESS_ASSIGN
|
||||
--- PROCESS_ASSIGN class
|
||||
-- @type PROCESS_ASSIGN
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||
PROCESS_ASSIGN = {
|
||||
ClassName = "PROCESS_ASSIGN",
|
||||
}
|
||||
@ -99,7 +99,7 @@ do -- PROCESS_ASSIGN
|
||||
function PROCESS_ASSIGN:New()
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_TEMPLATE:New( "PROCESS_ASSIGN" ) ) -- Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
local self = BASE:Inherit( self, FSM_TEMPLATE:New( "PROCESS_ASSIGN" ) ) -- Core.StateMachine#FSM_TEMPLATE
|
||||
|
||||
self:AddTransition( "UnAssigned", "Start", "Waiting" )
|
||||
self:AddTransition( "Waiting", "Assign", "Assigned" )
|
||||
@ -123,8 +123,8 @@ do -- PROCESS_ASSIGN_ACCEPT
|
||||
|
||||
--- PROCESS_ASSIGN_ACCEPT class
|
||||
-- @type PROCESS_ASSIGN_ACCEPT
|
||||
-- @field Task#TASK_BASE Task
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends Fsm.Process#PROCESS
|
||||
PROCESS_ASSIGN_ACCEPT = {
|
||||
@ -183,8 +183,8 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
||||
|
||||
--- PROCESS_ASSIGN_MENU_ACCEPT class
|
||||
-- @type PROCESS_ASSIGN_MENU_ACCEPT
|
||||
-- @field Task#TASK_BASE Task
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends #PROCESS_ASSIGN
|
||||
PROCESS_ASSIGN_MENU_ACCEPT = {
|
||||
@ -222,7 +222,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -256,7 +256,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -268,7 +268,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -12,7 +12,7 @@
|
||||
--
|
||||
-- * CARGO_GROUPED, represented by a Group of CARGO_UNITs.
|
||||
--
|
||||
-- 1) @{Cargo#CARGO_BASE} class, extends @{StateMachine#STATEMACHINE_PROCESS}
|
||||
-- 1) @{Fsm.Cargo#CARGO_BASE} class, extends @{Fsm.Fsm#FSM_PROCESS}
|
||||
-- ==========================================================================
|
||||
-- The @{#CARGO_BASE} class defines the core functions that defines a cargo object within MOOSE.
|
||||
-- A cargo is a logical object defined that is available for transport, and has a life status within a simulation.
|
||||
@ -74,14 +74,14 @@
|
||||
-- The cargo must be in the **UnLoaded** state.
|
||||
-- @function [parent=#CARGO_BASE] Board
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
|
||||
--- Boards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo to the Carrier.
|
||||
-- The cargo must be in the **UnLoaded** state.
|
||||
-- @function [parent=#CARGO_BASE] __Board
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
|
||||
|
||||
-- UnBoard
|
||||
@ -90,14 +90,14 @@
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO_BASE] UnBoard
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
|
||||
--- UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO_BASE] __UnBoard
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
|
||||
|
||||
-- Load
|
||||
@ -106,14 +106,14 @@
|
||||
-- The cargo must be in the **UnLoaded** state.
|
||||
-- @function [parent=#CARGO_BASE] Load
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
|
||||
--- Loads the cargo to a Carrier. The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
|
||||
-- The cargo must be in the **UnLoaded** state.
|
||||
-- @function [parent=#CARGO_BASE] __Load
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
|
||||
|
||||
|
||||
-- UnLoad
|
||||
@ -122,14 +122,14 @@
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO_BASE] UnLoad
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
|
||||
--- UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO_BASE] __UnLoad
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
|
||||
-- State Transition Functions
|
||||
|
||||
@ -137,62 +137,62 @@
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnBeforeUnLoaded
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @return #boolean
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnAfterUnLoaded
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
|
||||
-- Loaded
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnBeforeLoaded
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @return #boolean
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnAfterLoaded
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
|
||||
-- Boarding
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnBeforeBoarding
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @return #boolean
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnAfterBoarding
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
|
||||
-- UnBoarding
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnBeforeUnBoarding
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @return #boolean
|
||||
|
||||
--- @function [parent=#CARGO_BASE] OnAfterUnBoarding
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
|
||||
|
||||
-- TODO: Find all Carrier objects and make the type of the Carriers Unit#UNIT in the documentation.
|
||||
-- TODO: Find all Carrier objects and make the type of the Carriers Wrapper.Unit#UNIT in the documentation.
|
||||
|
||||
CARGOS = {}
|
||||
|
||||
do -- CARGO_BASE
|
||||
|
||||
--- @type CARGO_BASE
|
||||
-- @extends StateMachine#STATEMACHINE_PROCESS
|
||||
-- @extends Fsm.Fsm#FSM_PROCESS
|
||||
-- @field #string Type A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.
|
||||
-- @field #string Name A string defining the name of the cargo. The name is the unique identifier of the cargo.
|
||||
-- @field #number Weight A number defining the weight of the cargo. The weight is expressed in kg.
|
||||
-- @field #number ReportRadius (optional) A number defining the radius in meters when the cargo is signalling or reporting to a Carrier.
|
||||
-- @field #number NearRadius (optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.
|
||||
-- @field Controllable#CONTROLLABLE CargoObject The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...
|
||||
-- @field Controllable#CONTROLLABLE CargoCarrier The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE CargoObject The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE CargoCarrier The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...
|
||||
-- @field #boolean Slingloadable This flag defines if the cargo can be slingloaded.
|
||||
-- @field #boolean Moveable This flag defines if the cargo is moveable.
|
||||
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
|
||||
@ -211,7 +211,7 @@ do -- CARGO_BASE
|
||||
}
|
||||
|
||||
--- @type CARGO_BASE.CargoObjects
|
||||
-- @map < #string, Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
|
||||
-- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
|
||||
|
||||
|
||||
--- CARGO_BASE Constructor. This class is an abstract class and should not be instantiated.
|
||||
@ -238,7 +238,7 @@ function CARGO_BASE:New( Type, Name, Weight, ReportRadius, NearRadius )
|
||||
},
|
||||
}
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_PROCESS:New( FSMT ) ) -- #CARGO_BASE
|
||||
local self = BASE:Inherit( self, FSM_PROCESS:New( FSMT ) ) -- #CARGO_BASE
|
||||
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
|
||||
|
||||
|
||||
@ -274,7 +274,7 @@ end
|
||||
|
||||
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
||||
-- @param #CARGO_BASE self
|
||||
-- @param Point#POINT_VEC2 PointVec2
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2
|
||||
-- @return #boolean
|
||||
function CARGO_BASE:IsNear( PointVec2 )
|
||||
self:F( { PointVec2 } )
|
||||
@ -301,7 +301,7 @@ do -- CARGO_REPRESENTABLE
|
||||
|
||||
--- CARGO_REPRESENTABLE Constructor.
|
||||
-- @param #CARGO_REPRESENTABLE self
|
||||
-- @param Controllable#Controllable CargoObject
|
||||
-- @param Wrapper.Controllable#Controllable CargoObject
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
@ -320,7 +320,7 @@ end
|
||||
|
||||
--- Route a cargo unit to a PointVec2.
|
||||
-- @param #CARGO_REPRESENTABLE self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #number Speed
|
||||
-- @return #CARGO_REPRESENTABLE
|
||||
function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
|
||||
@ -350,7 +350,7 @@ do -- CARGO_UNIT
|
||||
|
||||
--- CARGO_UNIT Constructor.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Unit#UNIT CargoUnit
|
||||
-- @param Wrapper.Unit#UNIT CargoUnit
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
@ -371,7 +371,7 @@ end
|
||||
|
||||
--- Enter UnBoarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -416,7 +416,7 @@ end
|
||||
|
||||
--- Leave UnBoarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -440,7 +440,7 @@ end
|
||||
|
||||
--- UnBoard Event.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -465,7 +465,7 @@ end
|
||||
|
||||
--- Enter UnLoaded State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Point#POINT_VEC2
|
||||
-- @param Core.Point#POINT_VEC2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -503,7 +503,7 @@ end
|
||||
|
||||
--- Enter Boarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -535,7 +535,7 @@ end
|
||||
|
||||
--- Leave Boarding State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -553,7 +553,7 @@ end
|
||||
|
||||
--- Loaded State.
|
||||
-- @param #CARGO_UNIT self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -602,7 +602,7 @@ do -- CARGO_PACKAGE
|
||||
|
||||
--- CARGO_PACKAGE Constructor.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param Unit#UNIT CargoCarrier The UNIT carrying the package.
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier The UNIT carrying the package.
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
@ -621,11 +621,11 @@ end
|
||||
|
||||
--- Board Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #number Speed
|
||||
-- @param #number BoardDistance
|
||||
-- @param #number Angle
|
||||
@ -660,7 +660,7 @@ end
|
||||
|
||||
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @return #boolean
|
||||
function CARGO_PACKAGE:IsNear( CargoCarrier )
|
||||
self:F()
|
||||
@ -679,11 +679,11 @@ end
|
||||
|
||||
--- Boarded Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
function CARGO_PACKAGE:onafterOnBoarded( FsmP, Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle )
|
||||
self:F()
|
||||
|
||||
@ -696,7 +696,7 @@ end
|
||||
|
||||
--- UnBoard Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -739,11 +739,11 @@ end
|
||||
|
||||
--- UnBoarded Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
function CARGO_PACKAGE:onafterUnBoarded( FsmP, Event, From, To, CargoCarrier, Speed )
|
||||
self:F()
|
||||
|
||||
@ -756,11 +756,11 @@ end
|
||||
|
||||
--- Load Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #number Speed
|
||||
-- @param #number LoadDistance
|
||||
-- @param #number Angle
|
||||
@ -785,7 +785,7 @@ end
|
||||
|
||||
--- UnLoad Event.
|
||||
-- @param #CARGO_PACKAGE self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
||||
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -816,7 +816,7 @@ end
|
||||
do -- CARGO_GROUP
|
||||
|
||||
--- @type CARGO_GROUP
|
||||
-- @extends Cargo#CARGO_BASE
|
||||
-- @extends Fsm.Cargo#CARGO_BASE
|
||||
-- @field Set#SET_BASE CargoSet A set of cargo objects.
|
||||
-- @field #string Name A string defining the name of the cargo group. The name is the unique identifier of the cargo.
|
||||
CARGO_GROUP = {
|
||||
@ -825,7 +825,7 @@ do -- CARGO_GROUP
|
||||
|
||||
--- CARGO_GROUP constructor.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Set#Set_BASE CargoSet
|
||||
-- @param Core.Set#Set_BASE CargoSet
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
@ -847,14 +847,14 @@ end -- CARGO_GROUP
|
||||
do -- CARGO_GROUPED
|
||||
|
||||
--- @type CARGO_GROUPED
|
||||
-- @extends Cargo#CARGO_GROUP
|
||||
-- @extends Fsm.Cargo#CARGO_GROUP
|
||||
CARGO_GROUPED = {
|
||||
ClassName = "CARGO_GROUPED",
|
||||
}
|
||||
|
||||
--- CARGO_GROUPED constructor.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Set#Set_BASE CargoSet
|
||||
-- @param Core.Set#Set_BASE CargoSet
|
||||
-- @param #string Type
|
||||
-- @param #string Name
|
||||
-- @param #number Weight
|
||||
@ -870,7 +870,7 @@ end
|
||||
|
||||
--- Enter Boarding State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -893,7 +893,7 @@ end
|
||||
|
||||
--- Enter Loaded State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -910,7 +910,7 @@ end
|
||||
|
||||
--- Leave Boarding State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Unit#UNIT CargoCarrier
|
||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -937,7 +937,7 @@ end
|
||||
|
||||
--- Enter UnBoarding State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -963,7 +963,7 @@ end
|
||||
|
||||
--- Leave UnBoarding State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -998,7 +998,7 @@ end
|
||||
|
||||
--- UnBoard Event.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -1012,7 +1012,7 @@ end
|
||||
|
||||
--- Enter UnLoaded State.
|
||||
-- @param #CARGO_GROUPED self
|
||||
-- @param Point#POINT_VEC2
|
||||
-- @param Core.Point#POINT_VEC2
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- This module contains the STATEMACHINE class.
|
||||
--- This module contains the FSM class.
|
||||
-- This development is based on a state machine implementation made by Conroy Kyle.
|
||||
-- The state machine can be found here: https://github.com/kyleconroy/lua-state-machine
|
||||
--
|
||||
@ -7,26 +7,26 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Workflow#STATEMACHINE} class, extends @{Base#BASE}
|
||||
-- 1) @{Workflow#FSM} class, extends @{Core.Base#BASE}
|
||||
-- ==============================================
|
||||
--
|
||||
-- 1.1) Add or remove objects from the STATEMACHINE
|
||||
-- 1.1) Add or remove objects from the FSM
|
||||
-- --------------------------------------------
|
||||
-- @module StateMachine
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- STATEMACHINE class
|
||||
-- @type STATEMACHINE
|
||||
--- FSM class
|
||||
-- @type FSM
|
||||
-- @extends Core.Base#BASE
|
||||
STATEMACHINE = {
|
||||
ClassName = "STATEMACHINE",
|
||||
FSM = {
|
||||
ClassName = "FSM",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE object.
|
||||
-- @param #STATEMACHINE self
|
||||
-- @return #STATEMACHINE
|
||||
function STATEMACHINE:New( FsmT )
|
||||
--- Creates a new FSM object.
|
||||
-- @param #FSM self
|
||||
-- @return #FSM
|
||||
function FSM:New( FsmT )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
@ -49,7 +49,7 @@ function STATEMACHINE:New( FsmT )
|
||||
|
||||
self.Scores = {}
|
||||
|
||||
FsmT = FsmT or STATEMACHINE_TEMPLATE:New( "" )
|
||||
FsmT = FsmT or FSM_TEMPLATE:New( "" )
|
||||
|
||||
self:SetStartState( FsmT:GetStartState() )
|
||||
|
||||
@ -63,7 +63,7 @@ function STATEMACHINE:New( FsmT )
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE:AddTransition( From, Event, To )
|
||||
function FSM:AddTransition( From, Event, To )
|
||||
|
||||
local event = {}
|
||||
event.from = From
|
||||
@ -80,7 +80,7 @@ end
|
||||
|
||||
--- Set the default @{Process} template with key ProcessName providing the ProcessClass and the process object when it is assigned to a @{Controllable} by the task.
|
||||
-- @return Process#PROCESS
|
||||
function STATEMACHINE:AddProcess( From, Event, Process, ReturnEvents )
|
||||
function FSM:AddProcess( From, Event, Process, ReturnEvents )
|
||||
|
||||
local sub = {}
|
||||
sub.FromParent = From
|
||||
@ -96,21 +96,21 @@ function STATEMACHINE:AddProcess( From, Event, Process, ReturnEvents )
|
||||
return Process
|
||||
end
|
||||
|
||||
function STATEMACHINE:AddEndState( State )
|
||||
function FSM:AddEndState( State )
|
||||
self.endstates[State] = State
|
||||
end
|
||||
|
||||
function STATEMACHINE:SetStartState( State )
|
||||
function FSM:SetStartState( State )
|
||||
self.current = State
|
||||
end
|
||||
|
||||
function STATEMACHINE:GetSubs()
|
||||
function FSM:GetSubs()
|
||||
|
||||
return self.options.subs
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE:LoadCallBacks( CallBackTable )
|
||||
function FSM:LoadCallBacks( CallBackTable )
|
||||
|
||||
for name, callback in pairs( CallBackTable or {} ) do
|
||||
self[name] = callback
|
||||
@ -118,7 +118,7 @@ function STATEMACHINE:LoadCallBacks( CallBackTable )
|
||||
|
||||
end
|
||||
|
||||
function STATEMACHINE:_eventmap( events, event )
|
||||
function FSM:_eventmap( events, event )
|
||||
|
||||
local name = event.name
|
||||
local __name = "__" .. event.name
|
||||
@ -130,7 +130,7 @@ function STATEMACHINE:_eventmap( events, event )
|
||||
|
||||
end
|
||||
|
||||
function STATEMACHINE:_submap( subs, sub, name )
|
||||
function FSM:_submap( subs, sub, name )
|
||||
self:F( { sub = sub, name = name } )
|
||||
subs[sub.FromParent] = subs[sub.FromParent] or {}
|
||||
subs[sub.FromParent][sub.EventParent] = subs[sub.FromParent][sub.EventParent] or {}
|
||||
@ -147,14 +147,14 @@ function STATEMACHINE:_submap( subs, sub, name )
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE:_call_handler(handler, params)
|
||||
function FSM:_call_handler(handler, params)
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
return self[handler]( self, unpack(params) )
|
||||
end
|
||||
end
|
||||
|
||||
function STATEMACHINE._handler( self, EventName, ... )
|
||||
function FSM._handler( self, EventName, ... )
|
||||
|
||||
self:E( { EventName, ... } )
|
||||
|
||||
@ -225,7 +225,7 @@ function STATEMACHINE._handler( self, EventName, ... )
|
||||
return nil
|
||||
end
|
||||
|
||||
function STATEMACHINE:_delayed_transition( EventName )
|
||||
function FSM:_delayed_transition( EventName )
|
||||
self:E( { EventName = EventName } )
|
||||
return function( self, DelaySeconds, ... )
|
||||
self:T( "Delayed Event: " .. EventName )
|
||||
@ -233,12 +233,12 @@ function STATEMACHINE:_delayed_transition( EventName )
|
||||
end
|
||||
end
|
||||
|
||||
function STATEMACHINE:_create_transition( EventName )
|
||||
function FSM:_create_transition( EventName )
|
||||
self:E( { Event = EventName } )
|
||||
return function( self, ... ) return self._handler( self, EventName , ... ) end
|
||||
end
|
||||
|
||||
function STATEMACHINE:_gosub( ParentFrom, ParentEvent )
|
||||
function FSM:_gosub( ParentFrom, ParentEvent )
|
||||
local fsmtable = {}
|
||||
if self.subs[ParentFrom] and self.subs[ParentFrom][ParentEvent] then
|
||||
self:E( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
|
||||
@ -248,7 +248,7 @@ function STATEMACHINE:_gosub( ParentFrom, ParentEvent )
|
||||
end
|
||||
end
|
||||
|
||||
function STATEMACHINE:_isendstate( Current )
|
||||
function FSM:_isendstate( Current )
|
||||
local FSMParent = self.fsmparent
|
||||
if FSMParent and self.endstates[Current] then
|
||||
self:E( { state = Current, endstates = self.endstates, endstate = self.endstates[Current] } )
|
||||
@ -268,7 +268,7 @@ function STATEMACHINE:_isendstate( Current )
|
||||
return nil
|
||||
end
|
||||
|
||||
function STATEMACHINE:_add_to_map(map, event)
|
||||
function FSM:_add_to_map(map, event)
|
||||
self:F3( { map, event } )
|
||||
if type(event.from) == 'string' then
|
||||
map[event.from] = event.to
|
||||
@ -280,31 +280,31 @@ function STATEMACHINE:_add_to_map(map, event)
|
||||
self:T3( { map, event } )
|
||||
end
|
||||
|
||||
function STATEMACHINE:GetState()
|
||||
function FSM:GetState()
|
||||
return self.current
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE:Is( State )
|
||||
function FSM:Is( State )
|
||||
return self.current == State
|
||||
end
|
||||
|
||||
function STATEMACHINE:is(state)
|
||||
function FSM:is(state)
|
||||
return self.current == state
|
||||
end
|
||||
|
||||
function STATEMACHINE:can(e)
|
||||
function FSM:can(e)
|
||||
local event = self.events[e]
|
||||
self:F3( { self.current, event } )
|
||||
local to = event and event.map[self.current] or event.map['*']
|
||||
return to ~= nil, to
|
||||
end
|
||||
|
||||
function STATEMACHINE:cannot(e)
|
||||
function FSM:cannot(e)
|
||||
return not self:can(e)
|
||||
end
|
||||
|
||||
function STATEMACHINE:CopyCallHandlers( FsmT )
|
||||
function FSM:CopyCallHandlers( FsmT )
|
||||
|
||||
local Parent = BASE:GetParent( FsmT )
|
||||
if Parent then
|
||||
@ -325,7 +325,7 @@ function STATEMACHINE:CopyCallHandlers( FsmT )
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE:todot(filename)
|
||||
function FSM:todot(filename)
|
||||
local dotfile = io.open(filename,'w')
|
||||
dotfile:write('digraph {\n')
|
||||
local transition = function(event,from,to)
|
||||
@ -348,8 +348,8 @@ end
|
||||
|
||||
--- STATEMACHINE_CONTROLLABLE class
|
||||
-- @type STATEMACHINE_CONTROLLABLE
|
||||
-- @field Controllable#CONTROLLABLE Controllable
|
||||
-- @extends Core.StateMachine#STATEMACHINE
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @extends Core.StateMachine#FSM
|
||||
STATEMACHINE_CONTROLLABLE = {
|
||||
ClassName = "STATEMACHINE_CONTROLLABLE",
|
||||
}
|
||||
@ -357,12 +357,12 @@ STATEMACHINE_CONTROLLABLE = {
|
||||
--- Creates a new STATEMACHINE_CONTROLLABLE object.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
-- @param #table FSMT Finite State Machine Table
|
||||
-- @param Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @return #STATEMACHINE_CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE:New( FSMT ) ) -- StateMachine#STATEMACHINE_CONTROLLABLE
|
||||
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
|
||||
if Controllable then
|
||||
self:SetControllable( Controllable )
|
||||
@ -373,7 +373,7 @@ end
|
||||
|
||||
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE FSMControllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE FSMControllable
|
||||
-- @return #STATEMACHINE_CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
|
||||
self:F( FSMControllable )
|
||||
@ -382,7 +382,7 @@ end
|
||||
|
||||
--- Gets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||
-- @return Controllable#CONTROLLABLE
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE
|
||||
function STATEMACHINE_CONTROLLABLE:GetControllable()
|
||||
return self.Controllable
|
||||
end
|
||||
@ -406,21 +406,21 @@ function STATEMACHINE_CONTROLLABLE:_call_handler( handler, params )
|
||||
end
|
||||
end
|
||||
|
||||
--- STATEMACHINE_PROCESS class
|
||||
-- @type STATEMACHINE_PROCESS
|
||||
--- FSM_PROCESS class
|
||||
-- @type FSM_PROCESS
|
||||
-- @field Process#PROCESS Process
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
||||
STATEMACHINE_PROCESS = {
|
||||
ClassName = "STATEMACHINE_PROCESS",
|
||||
FSM_PROCESS = {
|
||||
ClassName = "FSM_PROCESS",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE_PROCESS object.
|
||||
-- @param #STATEMACHINE_PROCESS self
|
||||
-- @return #STATEMACHINE_PROCESS
|
||||
function STATEMACHINE_PROCESS:New( FsmT, Controllable, Task )
|
||||
--- Creates a new FSM_PROCESS object.
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @return #FSM_PROCESS
|
||||
function FSM_PROCESS:New( FsmT, Controllable, Task )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FsmT ) ) -- StateMachine#STATEMACHINE_PROCESS
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FsmT ) ) -- Fsm.Fsm#FSM_PROCESS
|
||||
|
||||
self:Assign( Controllable, Task )
|
||||
self.ClassName = FsmT._Name
|
||||
@ -431,7 +431,7 @@ function STATEMACHINE_PROCESS:New( FsmT, Controllable, Task )
|
||||
|
||||
for ProcessID, Process in pairs( FsmT:GetProcesses() ) do
|
||||
self:E( Process )
|
||||
local FsmProcess = self:AddProcess(Process.From, Process.Event, STATEMACHINE_PROCESS:New( Process.Process, Controllable, Task ), Process.ReturnEvents )
|
||||
local FsmProcess = self:AddProcess(Process.From, Process.Event, FSM_PROCESS:New( Process.Process, Controllable, Task ), Process.ReturnEvents )
|
||||
end
|
||||
|
||||
for EndStateID, EndState in pairs( FsmT:GetEndStates() ) do
|
||||
@ -439,6 +439,12 @@ function STATEMACHINE_PROCESS:New( FsmT, Controllable, Task )
|
||||
self:AddEndState( EndState )
|
||||
end
|
||||
|
||||
-- Copy the score tables
|
||||
for ScoreID, Score in pairs( FsmT:GetScores() ) do
|
||||
self:E( Score )
|
||||
self:AddScore( ScoreID,Score.ScoreText,Score.Score )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@ -446,7 +452,7 @@ end
|
||||
-- @param #PROCESS self
|
||||
-- @param Tasking.Task#TASK_BASE Task
|
||||
-- @return #PROCESS
|
||||
function STATEMACHINE_PROCESS:SetTask( Task )
|
||||
function FSM_PROCESS:SetTask( Task )
|
||||
|
||||
self.Task = Task
|
||||
|
||||
@ -455,27 +461,27 @@ end
|
||||
|
||||
--- Gets the task of the process.
|
||||
-- @param #PROCESS self
|
||||
-- @return Task#TASK_BASE
|
||||
function STATEMACHINE_PROCESS:GetTask()
|
||||
-- @return Tasking.Task#TASK_BASE
|
||||
function FSM_PROCESS:GetTask()
|
||||
|
||||
return self.Task
|
||||
end
|
||||
|
||||
--- Gets the mission of the process.
|
||||
-- @param #PROCESS self
|
||||
-- @return Mission#MISSION
|
||||
function STATEMACHINE_PROCESS:GetMission()
|
||||
-- @return Tasking.Mission#MISSION
|
||||
function FSM_PROCESS:GetMission()
|
||||
|
||||
return self.Task.Mission
|
||||
end
|
||||
|
||||
|
||||
--- Assign the process to a @{Unit} and activate the process.
|
||||
-- @param #STATEMACHINE_PROCESS self
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @param Task.Tasking#TASK_BASE Task
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @return #STATEMACHINE_PROCESS self
|
||||
function STATEMACHINE_PROCESS:Assign( ProcessUnit, Task )
|
||||
-- @return #FSM_PROCESS self
|
||||
function FSM_PROCESS:Assign( ProcessUnit, Task )
|
||||
self:E( { Task, ProcessUnit } )
|
||||
|
||||
self:SetControllable( ProcessUnit )
|
||||
@ -486,31 +492,47 @@ function STATEMACHINE_PROCESS:Assign( ProcessUnit, Task )
|
||||
return self
|
||||
end
|
||||
|
||||
function STATEMACHINE_PROCESS:onenterAssigned( ProcessUnit )
|
||||
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @param #string State is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #FSM_PROCESS self
|
||||
function FSM_PROCESS:AddScore( State, ScoreText, Score )
|
||||
self:F2( { State, ScoreText, Score } )
|
||||
|
||||
self.Scores[State] = self.Scores[State] or {}
|
||||
self.Scores[State].ScoreText = ScoreText
|
||||
self.Scores[State].Score = Score
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function FSM_PROCESS:onenterAssigned( ProcessUnit )
|
||||
self:E( "Assign" )
|
||||
|
||||
self.Task:Assign()
|
||||
end
|
||||
|
||||
function STATEMACHINE_PROCESS:onenterFailed( ProcessUnit )
|
||||
function FSM_PROCESS:onenterFailed( ProcessUnit )
|
||||
self:E( "Failed" )
|
||||
|
||||
self.Task:Fail()
|
||||
end
|
||||
|
||||
function STATEMACHINE_PROCESS:onenterSuccess( ProcessUnit )
|
||||
function FSM_PROCESS:onenterSuccess( ProcessUnit )
|
||||
self:E( "Success" )
|
||||
|
||||
self.Task:Success()
|
||||
end
|
||||
|
||||
--- StateMachine callback function for a STATEMACHINE_PROCESS
|
||||
-- @param #STATEMACHINE_PROCESS self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
--- StateMachine callback function for a FSM_PROCESS
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function STATEMACHINE_PROCESS:onstatechange( ProcessUnit, Event, From, To, Dummy )
|
||||
function FSM_PROCESS:onstatechange( ProcessUnit, Event, From, To, Dummy )
|
||||
self:E( { ProcessUnit, Event, From, To, Dummy, self:IsTrace() } )
|
||||
|
||||
if self:IsTrace() then
|
||||
@ -529,55 +551,55 @@ function STATEMACHINE_PROCESS:onstatechange( ProcessUnit, Event, From, To, Dummy
|
||||
end
|
||||
end
|
||||
|
||||
--- STATEMACHINE_TASK class
|
||||
-- @type STATEMACHINE_TASK
|
||||
-- @field Task#TASK_BASE Task
|
||||
-- @extends Core.StateMachine#STATEMACHINE
|
||||
STATEMACHINE_TASK = {
|
||||
ClassName = "STATEMACHINE_TASK",
|
||||
--- FSM_TASK class
|
||||
-- @type FSM_TASK
|
||||
-- @field Tasking.Task#TASK_BASE Task
|
||||
-- @extends Core.StateMachine#FSM
|
||||
FSM_TASK = {
|
||||
ClassName = "FSM_TASK",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE_TASK object.
|
||||
-- @param #STATEMACHINE_TASK self
|
||||
--- Creates a new FSM_TASK object.
|
||||
-- @param #FSM_TASK self
|
||||
-- @param #table FSMT
|
||||
-- @param Task#TASK_BASE Task
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @return #STATEMACHINE_TASK
|
||||
function STATEMACHINE_TASK:New( FSMT )
|
||||
-- @param Tasking.Task#TASK_BASE Task
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @return #FSM_TASK
|
||||
function FSM_TASK:New( FSMT )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) ) -- Core.StateMachine#STATEMACHINE_TASK
|
||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) ) -- Core.StateMachine#FSM_TASK
|
||||
|
||||
self["onstatechange"] = self.OnStateChange
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function STATEMACHINE_TASK:_call_handler( handler, params )
|
||||
function FSM_TASK:_call_handler( handler, params )
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
return self[handler]( self, unpack( params ) )
|
||||
end
|
||||
end
|
||||
|
||||
do -- STATEMACHINE_SET
|
||||
do -- FSM_SET
|
||||
|
||||
--- STATEMACHINE_SET class
|
||||
-- @type STATEMACHINE_SET
|
||||
-- @field Set#SET_BASE Set
|
||||
-- @extends StateMachine#STATEMACHINE
|
||||
STATEMACHINE_SET = {
|
||||
ClassName = "STATEMACHINE_SET",
|
||||
--- FSM_SET class
|
||||
-- @type FSM_SET
|
||||
-- @field Core.Set#SET_BASE Set
|
||||
-- @extends Fsm.Fsm#FSM
|
||||
FSM_SET = {
|
||||
ClassName = "FSM_SET",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE_SET object.
|
||||
-- @param #STATEMACHINE_SET self
|
||||
--- Creates a new FSM_SET object.
|
||||
-- @param #FSM_SET self
|
||||
-- @param #table FSMT Finite State Machine Table
|
||||
-- @param Set_SET_BASE FSMSet (optional) The Set object that the STATEMACHINE_SET governs.
|
||||
-- @return #STATEMACHINE_SET
|
||||
function STATEMACHINE_SET:New( FSMT, FSMSet )
|
||||
-- @param Set_SET_BASE FSMSet (optional) The Set object that the FSM_SET governs.
|
||||
-- @return #FSM_SET
|
||||
function FSM_SET:New( FSMT, FSMSet )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE:New( FSMT ) ) -- StateMachine#STATEMACHINE_SET
|
||||
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#FSM_SET
|
||||
|
||||
if FSMSet then
|
||||
self:Set( FSMSet )
|
||||
@ -586,23 +608,23 @@ function STATEMACHINE_SET:New( FSMT, FSMSet )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets the SET_BASE object that the STATEMACHINE_SET governs.
|
||||
-- @param #STATEMACHINE_SET self
|
||||
-- @param Set#SET_BASE FSMSet
|
||||
-- @return #STATEMACHINE_SET
|
||||
function STATEMACHINE_SET:Set( FSMSet )
|
||||
--- Sets the SET_BASE object that the FSM_SET governs.
|
||||
-- @param #FSM_SET self
|
||||
-- @param Core.Set#SET_BASE FSMSet
|
||||
-- @return #FSM_SET
|
||||
function FSM_SET:Set( FSMSet )
|
||||
self:F( FSMSet )
|
||||
self.Set = FSMSet
|
||||
end
|
||||
|
||||
--- Gets the SET_BASE object that the STATEMACHINE_SET governs.
|
||||
-- @param #STATEMACHINE_SET self
|
||||
-- @return Set#SET_BASE
|
||||
function STATEMACHINE_SET:Get()
|
||||
--- Gets the SET_BASE object that the FSM_SET governs.
|
||||
-- @param #FSM_SET self
|
||||
-- @return Core.Set#SET_BASE
|
||||
function FSM_SET:Get()
|
||||
return self.Controllable
|
||||
end
|
||||
|
||||
function STATEMACHINE_SET:_call_handler( handler, params )
|
||||
function FSM_SET:_call_handler( handler, params )
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
return self[handler]( self, self.Set, unpack( params ) )
|
||||
@ -611,20 +633,20 @@ end
|
||||
|
||||
end
|
||||
|
||||
--- STATEMACHINE_TEMPLATE class
|
||||
-- @type STATEMACHINE_TEMPLATE
|
||||
--- FSM_TEMPLATE class
|
||||
-- @type FSM_TEMPLATE
|
||||
-- @extends Core.Base#BASE
|
||||
STATEMACHINE_TEMPLATE = {
|
||||
ClassName = "STATEMACHINE_TEMPLATE",
|
||||
FSM_TEMPLATE = {
|
||||
ClassName = "FSM_TEMPLATE",
|
||||
}
|
||||
|
||||
--- Creates a new STATEMACHINE_TEMPLATE object.
|
||||
-- @param #STATEMACHINE_TEMPLATE self
|
||||
-- @return #STATEMACHINE_TEMPLATE
|
||||
function STATEMACHINE_TEMPLATE:New( Name )
|
||||
--- Creates a new FSM_TEMPLATE object.
|
||||
-- @param #FSM_TEMPLATE self
|
||||
-- @return #FSM_TEMPLATE
|
||||
function FSM_TEMPLATE:New( Name )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- #STATEMACHINE_TEMPLATE
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- #FSM_TEMPLATE
|
||||
|
||||
self._StartState = "none"
|
||||
self._Transitions = {}
|
||||
@ -637,7 +659,7 @@ function STATEMACHINE_TEMPLATE:New( Name )
|
||||
return self
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:AddTransition( From, Event, To )
|
||||
function FSM_TEMPLATE:AddTransition( From, Event, To )
|
||||
|
||||
local Transition = {}
|
||||
Transition.From = From
|
||||
@ -647,14 +669,14 @@ function STATEMACHINE_TEMPLATE:AddTransition( From, Event, To )
|
||||
self._Transitions[Transition] = Transition
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetTransitions()
|
||||
function FSM_TEMPLATE:GetTransitions()
|
||||
|
||||
return self._Transitions or {}
|
||||
end
|
||||
|
||||
--- Set the default @{Process} template with key ProcessName providing the ProcessClass and the process object when it is assigned to a @{Controllable} by the task.
|
||||
-- @return Process#PROCESS
|
||||
function STATEMACHINE_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnEvents )
|
||||
function FSM_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnEvents )
|
||||
|
||||
self:E( { ProcessTemplate = ProcessTemplate } )
|
||||
|
||||
@ -674,12 +696,12 @@ function STATEMACHINE_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnE
|
||||
return ProcessTemplate
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetProcesses()
|
||||
function FSM_TEMPLATE:GetProcesses()
|
||||
|
||||
return self._Processes or {}
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetProcess( From, Event )
|
||||
function FSM_TEMPLATE:GetProcess( From, Event )
|
||||
|
||||
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
||||
if Process.From == From and Process.Event == Event then
|
||||
@ -691,42 +713,42 @@ function STATEMACHINE_TEMPLATE:GetProcess( From, Event )
|
||||
error( "Sub-Process from state " .. From .. " with event " .. Event .. " not found!" )
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:SetParameters( Parameters )
|
||||
function FSM_TEMPLATE:SetParameters( Parameters )
|
||||
self._Parameters = Parameters
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetParameters()
|
||||
function FSM_TEMPLATE:GetParameters()
|
||||
return self._Parameters or {}
|
||||
end
|
||||
|
||||
|
||||
function STATEMACHINE_TEMPLATE:AddEndState( State )
|
||||
function FSM_TEMPLATE:AddEndState( State )
|
||||
|
||||
self._EndStates[State] = State
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetEndStates()
|
||||
function FSM_TEMPLATE:GetEndStates()
|
||||
|
||||
return self._EndStates or {}
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:SetStartState( State )
|
||||
function FSM_TEMPLATE:SetStartState( State )
|
||||
|
||||
self._StartState = State
|
||||
end
|
||||
|
||||
function STATEMACHINE_TEMPLATE:GetStartState()
|
||||
function FSM_TEMPLATE:GetStartState()
|
||||
|
||||
return self._StartState or {}
|
||||
end
|
||||
|
||||
--- Adds a score for the STATEMACHINE_PROCESS to be achieved.
|
||||
-- @param #STATEMACHINE_TEMPLATE self
|
||||
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||
-- @param #FSM_TEMPLATE self
|
||||
-- @param #string State is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #STATEMACHINE_TEMPLATE self
|
||||
function STATEMACHINE_TEMPLATE:AddScore( State, ScoreText, Score )
|
||||
-- @return #FSM_TEMPLATE self
|
||||
function FSM_TEMPLATE:AddScore( State, ScoreText, Score )
|
||||
self:F2( { State, ScoreText, Score } )
|
||||
|
||||
self._Scores[State] = self._Scores[State] or {}
|
||||
@ -736,15 +758,15 @@ function STATEMACHINE_TEMPLATE:AddScore( State, ScoreText, Score )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a score for the STATEMACHINE_PROCESS to be achieved.
|
||||
-- @param #STATEMACHINE_TEMPLATE self
|
||||
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||
-- @param #FSM_TEMPLATE self
|
||||
-- @param #string From is the From State of the main process.
|
||||
-- @param #string Event is the Event of the main process.
|
||||
-- @param #string State is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #STATEMACHINE_TEMPLATE self
|
||||
function STATEMACHINE_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, Score )
|
||||
-- @return #FSM_TEMPLATE self
|
||||
function FSM_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, Score )
|
||||
self:F2( { Event, State, ScoreText, Score } )
|
||||
|
||||
local Process = self:GetProcess( From, Event )
|
||||
@ -757,3 +779,7 @@ function STATEMACHINE_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, S
|
||||
return Process
|
||||
end
|
||||
|
||||
function FSM_TEMPLATE:GetScores()
|
||||
|
||||
return self._Scores or {}
|
||||
end
|
||||
@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{#PATROLZONE} class, extends @{StateMachine#STATEMACHINE}
|
||||
-- 1) @{#PATROLZONE} class, extends @{Fsm.Fsm#FSM}
|
||||
-- ================================================================
|
||||
-- The @{#PATROLZONE} class implements the core functions to patrol a @{Zone} by an AIR @{Controllable} @{Group}.
|
||||
-- The patrol algorithm works that for each airplane patrolling, upon arrival at the patrol zone,
|
||||
@ -68,7 +68,7 @@
|
||||
--
|
||||
-- --- State transition function for the PATROLZONE **Patrol** object
|
||||
-- -- @param #PATROLZONE self
|
||||
-- -- @param Controllable#CONTROLLABLE AIGroup
|
||||
-- -- @param Wrapper.Controllable#CONTROLLABLE AIGroup
|
||||
-- -- @return #boolean If false is returned, then the OnAfter state transition method will not be called.
|
||||
-- function Patrol:OnBeforeRTB( AIGroup )
|
||||
-- AIGroup:MessageToRed( "Returning to base", 20 )
|
||||
@ -78,8 +78,8 @@
|
||||
--
|
||||
-- --- State transition function for the PATROLZONE **Patrol** object
|
||||
-- -- @param #PATROLZONE self
|
||||
-- -- @param Controllable#CONTROLLABLE AIGroup
|
||||
-- -- @return #Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
|
||||
-- -- @param Wrapper.Controllable#CONTROLLABLE AIGroup
|
||||
-- -- @return #Wrapper.Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
|
||||
-- function Patrol:OnAfterRTB( AIGroup )
|
||||
-- return PatrolSpawn:Spawn()
|
||||
-- end
|
||||
@ -137,25 +137,25 @@
|
||||
--- OnBefore State Transition Function
|
||||
-- @function [parent=#PATROLZONE] OnBeforeRoute
|
||||
-- @param #PATROLZONE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @return #boolean
|
||||
|
||||
--- OnAfter State Transition Function
|
||||
-- @function [parent=#PATROLZONE] OnAfterRoute
|
||||
-- @param #PATROLZONE self
|
||||
-- @param Controllable#CONTROLLABLE Controllable
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
|
||||
|
||||
|
||||
--- PATROLZONE class
|
||||
-- @type PATROLZONE
|
||||
-- @field Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
||||
-- @field Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @field DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @field DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @field DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @field DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @extends StateMachine#STATEMACHINE_CONTROLLABLE
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
||||
-- @field Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @field Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @field Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @field Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @field Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||
PATROLZONE = {
|
||||
ClassName = "PATROLZONE",
|
||||
}
|
||||
@ -164,11 +164,11 @@ PATROLZONE = {
|
||||
|
||||
--- Creates a new PATROLZONE object
|
||||
-- @param #PATROLZONE self
|
||||
-- @param Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @return #PATROLZONE self
|
||||
-- @usage
|
||||
-- -- Define a new PATROLZONE Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
|
||||
@ -206,8 +206,8 @@ end
|
||||
|
||||
--- Sets (modifies) the minimum and maximum speed of the patrol.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
|
||||
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
|
||||
@ -220,8 +220,8 @@ end
|
||||
|
||||
--- Sets the floor and ceiling altitude of the patrol.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
|
||||
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
|
||||
@ -232,7 +232,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- @param Controllable#CONTROLLABLE AIControllable
|
||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||
function _NewPatrolRoute( AIControllable )
|
||||
|
||||
AIControllable:T( "NewPatrolRoute" )
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
--- The PROCESS class
|
||||
-- @type PROCESS
|
||||
-- @field Task#TASK_BASE ProcessTask
|
||||
-- @field Group#GROUP ProcessGroup
|
||||
-- @field Menu#MENU_GROUP MissionMenu
|
||||
-- @field Tasking.Task#TASK_BASE ProcessTask
|
||||
-- @field Wrapper.Group#GROUP ProcessGroup
|
||||
-- @field Core.Menu#MENU_GROUP MissionMenu
|
||||
-- @field #string ProcessName
|
||||
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
||||
PROCESS = {
|
||||
@ -16,10 +16,10 @@ PROCESS = {
|
||||
--- Instantiates a new TASK Base. Should never be used. Interface Class.
|
||||
-- @param #PROCESS self
|
||||
-- @param #string ProcessName
|
||||
-- @param Unit#UNIT ProcessUnit (Optional) If provided, it defines the UNIT for which the process is running.
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit (Optional) If provided, it defines the UNIT for which the process is running.
|
||||
-- @return #PROCESS
|
||||
function PROCESS:New( FSMT, ProcessName, ProcessUnit )
|
||||
local self = BASE:Inherit( self, STATEMACHINE_PROCESS:New( FSMT, ProcessUnit ) )
|
||||
local self = BASE:Inherit( self, FSM_PROCESS:New( FSMT, ProcessUnit ) )
|
||||
self:F()
|
||||
|
||||
if ProcessUnit then
|
||||
@ -35,7 +35,7 @@ end
|
||||
|
||||
--- Gets the Group of the process.
|
||||
-- @param #PROCESS self
|
||||
-- @return Group#GROUP
|
||||
-- @return Wrapper.Group#GROUP
|
||||
function PROCESS:GetGroup()
|
||||
|
||||
return self.ProcessGroup
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
--- PROCESS_JTAC class
|
||||
-- @type PROCESS_JTAC
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Core.Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Process#PROCESS
|
||||
PROCESS_JTAC = {
|
||||
ClassName = "PROCESS_JTAC",
|
||||
@ -14,10 +14,10 @@ PROCESS_JTAC = {
|
||||
|
||||
--- Creates a new DESTROY process.
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param Task#TASK Task
|
||||
-- @param Unit#UNIT ProcessUnit
|
||||
-- @param Set#SET_UNIT TargetSetUnit
|
||||
-- @param Unit#UNIT FACUnit
|
||||
-- @param Tasking.Task#TASK Task
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @param Core.Set#SET_UNIT TargetSetUnit
|
||||
-- @param Wrapper.Unit#UNIT FACUnit
|
||||
-- @return #PROCESS_JTAC self
|
||||
function PROCESS_JTAC:New( Task, ProcessUnit, TargetSetUnit, FACUnit )
|
||||
|
||||
@ -34,7 +34,7 @@ function PROCESS_JTAC:New( Task, ProcessUnit, TargetSetUnit, FACUnit )
|
||||
self.DisplayCategory = "HQ" -- Targets is the default display category
|
||||
|
||||
|
||||
self.Fsm = STATEMACHINE_PROCESS:New( self, {
|
||||
self.Fsm = FSM_PROCESS:New( self, {
|
||||
initial = 'Assigned',
|
||||
events = {
|
||||
{ name = 'Start', from = 'Assigned', to = 'CreatedMenu' },
|
||||
@ -66,7 +66,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -77,7 +77,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -123,7 +123,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -131,7 +131,7 @@ function PROCESS_JTAC:OnJTACMenuAwait( Fsm, Event, From, To )
|
||||
|
||||
if self.DisplayCount >= self.DisplayInterval then
|
||||
|
||||
local TaskJTAC = self.Task -- Task#TASK_JTAC
|
||||
local TaskJTAC = self.Task -- Tasking.Task#TASK_JTAC
|
||||
TaskJTAC.Spots = TaskJTAC.Spots or {}
|
||||
for TargetUnitName, SpotData in pairs( TaskJTAC.Spots) do
|
||||
local TargetUnit = UNIT:FindByName( TargetUnitName )
|
||||
@ -147,16 +147,16 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT TargetUnit
|
||||
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||
function PROCESS_JTAC:OnJTACMenuSpot( Fsm, Event, From, To, TargetUnit )
|
||||
|
||||
local TargetUnitName = TargetUnit:GetName()
|
||||
|
||||
local TaskJTAC = self.Task -- Task#TASK_JTAC
|
||||
local TaskJTAC = self.Task -- Tasking.Task#TASK_JTAC
|
||||
|
||||
TaskJTAC.Spots = TaskJTAC.Spots or {}
|
||||
TaskJTAC.Spots[TargetUnitName] = TaskJTAC.Spots[TargetUnitName] or {}
|
||||
@ -174,16 +174,16 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_JTAC self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Unit#UNIT TargetUnit
|
||||
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||
function PROCESS_JTAC:OnJTACMenuCancel( Fsm, Event, From, To, TargetUnit )
|
||||
|
||||
local TargetUnitName = TargetUnit:GetName()
|
||||
|
||||
local TaskJTAC = self.Task -- Task#TASK_JTAC
|
||||
local TaskJTAC = self.Task -- Tasking.Task#TASK_JTAC
|
||||
|
||||
TaskJTAC.Spots = TaskJTAC.Spots or {}
|
||||
if TaskJTAC.Spots[TargetUnitName] then
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
--- PROCESS_PICKUP class
|
||||
-- @type PROCESS_PICKUP
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Set#SET_UNIT TargetSetUnit
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Core.Set#SET_UNIT TargetSetUnit
|
||||
-- @extends Process#PROCESS
|
||||
PROCESS_PICKUP = {
|
||||
ClassName = "PROCESS_PICKUP",
|
||||
@ -14,9 +14,9 @@ PROCESS_PICKUP = {
|
||||
|
||||
--- Creates a new DESTROY process.
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param Task#TASK Task
|
||||
-- @param Unit#UNIT ProcessUnit
|
||||
-- @param Set#SET_UNIT TargetSetUnit
|
||||
-- @param Tasking.Task#TASK Task
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @param Core.Set#SET_UNIT TargetSetUnit
|
||||
-- @return #PROCESS_PICKUP self
|
||||
function PROCESS_PICKUP:New( Task, ProcessName, ProcessUnit )
|
||||
|
||||
@ -29,7 +29,7 @@ function PROCESS_PICKUP:New( Task, ProcessName, ProcessUnit )
|
||||
self.DisplayTime = 10 -- 10 seconds is the default
|
||||
self.DisplayCategory = "HQ" -- Targets is the default display category
|
||||
|
||||
self.Fsm = STATEMACHINE_PROCESS:New( self, {
|
||||
self.Fsm = FSM_PROCESS:New( self, {
|
||||
initial = 'Assigned',
|
||||
events = {
|
||||
{ name = 'Start', from = 'Assigned', to = 'Navigating' },
|
||||
@ -57,7 +57,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -68,7 +68,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -89,11 +89,11 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function PROCESS_PICKUP:OnHitTarget( Fsm, Event, From, To, Event )
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -126,11 +126,11 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA DCSEvent
|
||||
-- @param Core.Event#EVENTDATA DCSEvent
|
||||
function PROCESS_PICKUP:OnKilled( Fsm, Event, From, To )
|
||||
|
||||
self:NextEvent( Fsm.Restart )
|
||||
@ -139,7 +139,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -151,7 +151,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a PROCESS
|
||||
-- @param #PROCESS_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
||||
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -162,7 +162,7 @@ end
|
||||
--- DCS Events
|
||||
|
||||
--- @param #PROCESS_PICKUP self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function PROCESS_PICKUP:EventDead( Event )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#PROCESS_ROUTE_ZONE} class, extends @{Route#PROCESS_ROUTE}
|
||||
-- # 1) @{#PROCESS_ROUTE_ZONE} class, extends @{Fsm.Route#PROCESS_ROUTE}
|
||||
--
|
||||
-- The PROCESS_ROUTE_ZONE class implements the core functions to route an AIR @{Controllable} player @{Unit} to a @{Zone}.
|
||||
-- The player receives on perioding times messages with the coordinates of the route to follow.
|
||||
@ -79,10 +79,10 @@ do -- PROCESS_ROUTE
|
||||
|
||||
--- PROCESS_ROUTE class
|
||||
-- @type PROCESS_ROUTE
|
||||
-- @field Task#TASK TASK
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Tasking.Task#TASK TASK
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||
PROCESS_ROUTE = {
|
||||
ClassName = "PROCESS_ROUTE",
|
||||
}
|
||||
@ -94,7 +94,7 @@ do -- PROCESS_ROUTE
|
||||
function PROCESS_ROUTE:New()
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_TEMPLATE:New( "PROCESS_ROUTE" ) ) -- Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
local self = BASE:Inherit( self, FSM_TEMPLATE:New( "PROCESS_ROUTE" ) ) -- Core.StateMachine#FSM_TEMPLATE
|
||||
|
||||
self:AddTransition( "None", "Start", "Routing" )
|
||||
self:AddTransition( "*", "Report", "Reporting" )
|
||||
@ -119,7 +119,7 @@ do -- PROCESS_ROUTE
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ROUTE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -131,7 +131,7 @@ do -- PROCESS_ROUTE
|
||||
|
||||
--- Check if the controllable has arrived.
|
||||
-- @param #PROCESS_ROUTE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @return #boolean
|
||||
function PROCESS_ROUTE:onfuncHasArrived( ProcessUnit )
|
||||
return false
|
||||
@ -139,7 +139,7 @@ do -- PROCESS_ROUTE
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ROUTE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -180,8 +180,8 @@ do -- PROCESS_ROUTE_ZONE
|
||||
|
||||
--- PROCESS_ROUTE_ZONE class
|
||||
-- @type PROCESS_ROUTE_ZONE
|
||||
-- @field Task#TASK TASK
|
||||
-- @field Unit#UNIT ProcessUnit
|
||||
-- @field Tasking.Task#TASK TASK
|
||||
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @field Zone#ZONE_BASE TargetZone
|
||||
-- @extends #PROCESS_ROUTE
|
||||
PROCESS_ROUTE_ZONE = {
|
||||
@ -225,7 +225,7 @@ do -- PROCESS_ROUTE_ZONE
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_ROUTE_ZONE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -52,7 +52,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#PROCESS_SMOKE_TARGETS_ZONE} class, extends @{Route#PROCESS_SMOKE}
|
||||
-- # 1) @{#PROCESS_SMOKE_TARGETS_ZONE} class, extends @{Fsm.Route#PROCESS_SMOKE}
|
||||
--
|
||||
-- The PROCESS_SMOKE_TARGETS_ZONE class implements the core functions to smoke targets in a @{Zone}.
|
||||
-- The targets are smoked within a certain range around each target, simulating a realistic smoking behaviour.
|
||||
@ -70,7 +70,7 @@ do -- PROCESS_SMOKE
|
||||
|
||||
--- PROCESS_SMOKE class
|
||||
-- @type PROCESS_SMOKE
|
||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||
PROCESS_SMOKE = {
|
||||
ClassName = "PROCESS_SMOKE",
|
||||
}
|
||||
@ -81,7 +81,7 @@ do -- PROCESS_SMOKE
|
||||
function PROCESS_SMOKE:New()
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_TEMPLATE:New( "PROCESS_SMOKE" ) ) -- Core.StateMachine#STATEMACHINE_TEMPLATE
|
||||
local self = BASE:Inherit( self, FSM_TEMPLATE:New( "PROCESS_SMOKE" ) ) -- Core.StateMachine#FSM_TEMPLATE
|
||||
|
||||
self:AddTransition( "None", "Start", "AwaitSmoke" )
|
||||
self:AddTransition( "AwaitSmoke", "Next", "Smoking" )
|
||||
@ -101,13 +101,13 @@ do -- PROCESS_SMOKE
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_SMOKE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function PROCESS_SMOKE:onafterStart( ProcessUnit, Event, From, To )
|
||||
|
||||
local ProcessGroup = self:GetGroup()
|
||||
local ProcessGroup = ProcessUnit:GetGroup()
|
||||
local MissionMenu = self:GetMission():GetMissionMenu( ProcessGroup )
|
||||
|
||||
local function MenuSmoke( MenuParam )
|
||||
@ -173,14 +173,14 @@ do -- PROCESS_SMOKE_TARGETS_ZONE
|
||||
|
||||
--- StateMachine callback function
|
||||
-- @param #PROCESS_SMOKE_TARGETS_ZONE self
|
||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function PROCESS_SMOKE_TARGETS_ZONE:onenterSmoking( ProcessUnit, Event, From, To )
|
||||
|
||||
self.TargetSetUnit:ForEachUnit(
|
||||
--- @param Unit#UNIT SmokeUnit
|
||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
||||
function( SmokeUnit )
|
||||
if math.random( 1, ( 100 * self.TargetSetUnit:Count() ) / 4 ) <= 100 then
|
||||
SCHEDULER:New( self,
|
||||
@ -2,15 +2,15 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{AIBalancer#AIBALANCER} class, extends @{StateMachine#STATEMACHINE_SET}
|
||||
-- 1) @{Functional.AIBalancer#AIBALANCER} class, extends @{Fsm.Fsm#FSM_SET}
|
||||
-- ===================================================================================
|
||||
-- The @{AIBalancer#AIBALANCER} class monitors and manages as many AI GROUPS as there are
|
||||
-- The @{Functional.AIBalancer#AIBALANCER} class monitors and manages as many AI GROUPS as there are
|
||||
-- CLIENTS in a SET_CLIENT collection not occupied by players.
|
||||
-- The AIBALANCER class manages internally a collection of AI management objects, which govern the behaviour
|
||||
-- of the underlying AI GROUPS.
|
||||
--
|
||||
-- The parent class @{StateMachine#STATEMACHINE_SET} manages the functionality to control the Finite State Machine (FSM)
|
||||
-- and calls for each event the state transition methods providing the internal @{StateMachine#STATEMACHINE_SET.Set} object containing the
|
||||
-- The parent class @{Fsm.Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM)
|
||||
-- and calls for each event the state transition methods providing the internal @{Fsm.Fsm#FSM_SET.Set} object containing the
|
||||
-- SET_GROUP and additional event parameters provided during the event.
|
||||
--
|
||||
-- 1.1) AIBALANCER construction method
|
||||
@ -28,8 +28,8 @@
|
||||
-- ------------------------------------------
|
||||
-- You can configure to have the AI to return to:
|
||||
--
|
||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||
-- --
|
||||
-- ===
|
||||
--
|
||||
@ -73,8 +73,8 @@
|
||||
|
||||
--- AIBALANCER class
|
||||
-- @type AIBALANCER
|
||||
-- @field Set#SET_CLIENT SetClient
|
||||
-- @extends StateMachine#STATEMACHINE_SET
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
-- @extends Fsm.Fsm#FSM_SET
|
||||
AIBALANCER = {
|
||||
ClassName = "AIBALANCER",
|
||||
PatrolZones = {},
|
||||
@ -83,8 +83,8 @@ AIBALANCER = {
|
||||
|
||||
--- Creates a new AIBALANCER object
|
||||
-- @param #AIBALANCER self
|
||||
-- @param Set#SET_CLIENT SetClient A SET\_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player).
|
||||
-- @param Spawn#SPAWN SpawnAI The default Spawn object to spawn new AI Groups when needed.
|
||||
-- @param Core.Set#SET_CLIENT SetClient A SET\_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player).
|
||||
-- @param Functional.Spawn#SPAWN SpawnAI The default Spawn object to spawn new AI Groups when needed.
|
||||
-- @return #AIBALANCER
|
||||
-- @usage
|
||||
-- -- Define a new AIBALANCER Object.
|
||||
@ -104,7 +104,7 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
||||
}
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, STATEMACHINE_SET:New( FSMT, SET_GROUP:New() ) )
|
||||
local self = BASE:Inherit( self, FSM_SET:New( FSMT, SET_GROUP:New() ) )
|
||||
|
||||
self.SetClient = SetClient
|
||||
self.SpawnAI = SpawnAI
|
||||
@ -116,10 +116,10 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
--- Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
||||
-- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param Core.Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Core.Set#SET_AIRBASE}s to evaluate where to return to.
|
||||
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||
|
||||
self.ToNearestAirbase = true
|
||||
@ -127,9 +127,9 @@ function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseS
|
||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||
end
|
||||
|
||||
--- Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
--- Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
-- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}.
|
||||
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||
|
||||
self.ToHomeAirbase = true
|
||||
@ -137,9 +137,9 @@ function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||
end
|
||||
|
||||
--- @param #AIBALANCER self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Core.Set#SET_GROUP SetGroup
|
||||
-- @param #string ClientName
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function AIBALANCER:onenterSpawning( SetGroup, ClientName )
|
||||
|
||||
-- OK, Spawn a new group from the default SpawnAI object provided.
|
||||
@ -151,16 +151,16 @@ function AIBALANCER:onenterSpawning( SetGroup, ClientName )
|
||||
end
|
||||
|
||||
--- @param #AIBALANCER self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Core.Set#SET_GROUP SetGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function AIBALANCER:onenterDestroying( SetGroup, AIGroup )
|
||||
|
||||
AIGroup:Destroy()
|
||||
end
|
||||
|
||||
--- @param #AIBALANCER self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Core.Set#SET_GROUP SetGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function AIBALANCER:onenterReturning( SetGroup, AIGroup )
|
||||
|
||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||
@ -188,11 +188,11 @@ end
|
||||
function AIBALANCER:onenterMonitoring( SetGroup )
|
||||
|
||||
self.SetClient:ForEachClient(
|
||||
--- @param Client#CLIENT Client
|
||||
--- @param Wrapper.Client#CLIENT Client
|
||||
function( Client )
|
||||
self:E(Client.ClientName)
|
||||
|
||||
local AIGroup = self.Set:Get( Client.UnitName ) -- Group#GROUP
|
||||
local AIGroup = self.Set:Get( Client.UnitName ) -- Wrapper.Group#GROUP
|
||||
if Client:IsAlive() then
|
||||
|
||||
if AIGroup and AIGroup:IsAlive() == true then
|
||||
@ -210,7 +210,7 @@ function AIBALANCER:onenterMonitoring( SetGroup )
|
||||
self:E( RangeZone )
|
||||
|
||||
_DATABASE:ForEachPlayer(
|
||||
--- @param Unit#UNIT RangeTestUnit
|
||||
--- @param Wrapper.Unit#UNIT RangeTestUnit
|
||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||
@ -223,7 +223,7 @@ function AIBALANCER:onenterMonitoring( SetGroup )
|
||||
end,
|
||||
|
||||
--- @param Zone#ZONE_RADIUS RangeZone
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function( RangeZone, AIGroup, PlayerInRange )
|
||||
if PlayerInRange.Value == false then
|
||||
self:Return( AIGroup )
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{AirbasePolice#AIRBASEPOLICE_BASE} class, extends @{Base#BASE}
|
||||
-- 1) @{Functional.AirbasePolice#AIRBASEPOLICE_BASE} class, extends @{Core.Base#BASE}
|
||||
-- ==================================================================
|
||||
-- The @{AirbasePolice#AIRBASEPOLICE_BASE} class provides the main methods to monitor CLIENT behaviour at airbases.
|
||||
-- The @{Functional.AirbasePolice#AIRBASEPOLICE_BASE} class provides the main methods to monitor CLIENT behaviour at airbases.
|
||||
-- CLIENTS should not be allowed to:
|
||||
--
|
||||
-- * Don't taxi faster than 40 km/h.
|
||||
@ -12,7 +12,7 @@
|
||||
-- * Avoid to hit other planes on the airbase.
|
||||
-- * Obey ground control orders.
|
||||
--
|
||||
-- 2) @{AirbasePolice#AIRBASEPOLICE_CAUCASUS} class, extends @{AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- 2) @{Functional.AirbasePolice#AIRBASEPOLICE_CAUCASUS} class, extends @{Functional.AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- =============================================================================================
|
||||
-- All the airbases on the caucasus map can be monitored using this class.
|
||||
-- If you want to monitor specific airbases, you need to use the @{#AIRBASEPOLICE_BASE.Monitor}() method, which takes a table or airbase names.
|
||||
@ -39,7 +39,7 @@
|
||||
-- * TbilisiLochini
|
||||
-- * Vaziani
|
||||
--
|
||||
-- 3) @{AirbasePolice#AIRBASEPOLICE_NEVADA} class, extends @{AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- 3) @{Functional.AirbasePolice#AIRBASEPOLICE_NEVADA} class, extends @{Functional.AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- =============================================================================================
|
||||
-- All the airbases on the NEVADA map can be monitored using this class.
|
||||
-- If you want to monitor specific airbases, you need to use the @{#AIRBASEPOLICE_BASE.Monitor}() method, which takes a table or airbase names.
|
||||
@ -59,8 +59,8 @@
|
||||
|
||||
|
||||
--- @type AIRBASEPOLICE_BASE
|
||||
-- @field Set#SET_CLIENT SetClient
|
||||
-- @extends Base#BASE
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
AIRBASEPOLICE_BASE = {
|
||||
ClassName = "AIRBASEPOLICE_BASE",
|
||||
@ -99,7 +99,7 @@ function AIRBASEPOLICE_BASE:New( SetClient, Airbases )
|
||||
-- self.Airbases.Template.ZoneRunways[1] = ZONE_POLYGON:New( "Template Runway 1", TemplateRunway1 ):SmokeZone(POINT_VEC3.SmokeColor.Red):Flush()
|
||||
|
||||
self.SetClient:ForEachClient(
|
||||
--- @param Client#CLIENT Client
|
||||
--- @param Wrapper.Client#CLIENT Client
|
||||
function( Client )
|
||||
Client:SetState( self, "Speeding", false )
|
||||
Client:SetState( self, "Warnings", 0)
|
||||
@ -141,7 +141,7 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
|
||||
|
||||
self.SetClient:ForEachClientInZone( Airbase.ZoneBoundary,
|
||||
|
||||
--- @param Client#CLIENT Client
|
||||
--- @param Wrapper.Client#CLIENT Client
|
||||
function( Client )
|
||||
|
||||
self:E( Client.UnitName )
|
||||
@ -219,7 +219,7 @@ end
|
||||
|
||||
|
||||
--- @type AIRBASEPOLICE_CAUCASUS
|
||||
-- @field Set#SET_CLIENT SetClient
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
-- @extends #AIRBASEPOLICE_BASE
|
||||
|
||||
AIRBASEPOLICE_CAUCASUS = {
|
||||
@ -960,7 +960,7 @@ end
|
||||
|
||||
|
||||
--- @type AIRBASEPOLICE_NEVADA
|
||||
-- @extends AirbasePolice#AIRBASEPOLICE_BASE
|
||||
-- @extends Functional.AirbasePolice#AIRBASEPOLICE_BASE
|
||||
AIRBASEPOLICE_NEVADA = {
|
||||
ClassName = "AIRBASEPOLICE_NEVADA",
|
||||
Airbases = {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
--- The CLEANUP class.
|
||||
-- @type CLEANUP
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
CLEANUP = {
|
||||
ClassName = "CLEANUP",
|
||||
ZoneNames = {},
|
||||
@ -51,7 +51,7 @@ end
|
||||
|
||||
--- Destroys a group from the simulator, but checks first if it is still existing!
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSGroup#Group GroupObject The object to be destroyed.
|
||||
-- @param Dcs.DCSWrapper.Group#Group GroupObject The object to be destroyed.
|
||||
-- @param #string CleanUpGroupName The groupname...
|
||||
function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
||||
self:F( { GroupObject, CleanUpGroupName } )
|
||||
@ -62,9 +62,9 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
||||
end
|
||||
end
|
||||
|
||||
--- Destroys a @{DCSUnit#Unit} from the simulator, but checks first if it is still existing!
|
||||
--- Destroys a @{Dcs.DCSWrapper.Unit#Unit} from the simulator, but checks first if it is still existing!
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSUnit#Unit CleanUpUnit The object to be destroyed.
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit CleanUpUnit The object to be destroyed.
|
||||
-- @param #string CleanUpUnitName The Unit name ...
|
||||
function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName )
|
||||
self:F( { CleanUpUnit, CleanUpUnitName } )
|
||||
@ -89,10 +89,10 @@ function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName )
|
||||
end
|
||||
end
|
||||
|
||||
-- TODO check DCSTypes#Weapon
|
||||
-- TODO check Dcs.DCSTypes#Weapon
|
||||
--- Destroys a missile from the simulator, but checks first if it is still existing!
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSTypes#Weapon MissileObject
|
||||
-- @param Dcs.DCSTypes#Weapon MissileObject
|
||||
function CLEANUP:_DestroyMissile( MissileObject )
|
||||
self:F( { MissileObject } )
|
||||
|
||||
@ -134,7 +134,7 @@ end
|
||||
--- Detects if a crash event occurs.
|
||||
-- Crashed units go into a CleanUpList for removal.
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSTypes#Event event
|
||||
-- @param Dcs.DCSTypes#Event event
|
||||
function CLEANUP:_EventCrash( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
@ -157,7 +157,7 @@ end
|
||||
--- Detects if a unit shoots a missile.
|
||||
-- If this occurs within one of the zones, then the weapon used must be destroyed.
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSTypes#Event event
|
||||
-- @param Dcs.DCSTypes#Event event
|
||||
function CLEANUP:_EventShot( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
@ -174,7 +174,7 @@ end
|
||||
|
||||
--- Detects if the Unit has an S_EVENT_HIT within the given ZoneNames. If this is the case, destroy the unit.
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSTypes#Event event
|
||||
-- @param Dcs.DCSTypes#Event event
|
||||
function CLEANUP:_EventHitCleanUp( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
@ -199,7 +199,7 @@ function CLEANUP:_EventHitCleanUp( Event )
|
||||
end
|
||||
end
|
||||
|
||||
--- Add the @{DCSUnit#Unit} to the CleanUpList for CleanUp.
|
||||
--- Add the @{Dcs.DCSWrapper.Unit#Unit} to the CleanUpList for CleanUp.
|
||||
function CLEANUP:_AddForCleanUp( CleanUpUnit, CleanUpUnitName )
|
||||
self:F( { CleanUpUnit, CleanUpUnitName } )
|
||||
|
||||
@ -217,7 +217,7 @@ end
|
||||
|
||||
--- Detects if the Unit has an S_EVENT_ENGINE_SHUTDOWN or an S_EVENT_HIT within the given ZoneNames. If this is the case, add the Group to the CLEANUP List.
|
||||
-- @param #CLEANUP self
|
||||
-- @param DCSTypes#Event event
|
||||
-- @param Dcs.DCSTypes#Event event
|
||||
function CLEANUP:_EventAddForCleanUp( Event )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Detection#DETECTION_BASE} class, extends @{Base#BASE}
|
||||
-- 1) @{Functional.Detection#DETECTION_BASE} class, extends @{Core.Base#BASE}
|
||||
-- ==========================================================
|
||||
-- The @{Detection#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{Detection#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
-- The @{Functional.Detection#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{Functional.Detection#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- 1.1) DETECTION_BASE constructor
|
||||
-- -------------------------------
|
||||
-- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION_BASE.New}() method.
|
||||
-- Construct a new DETECTION_BASE instance using the @{Functional.Detection#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- 1.2) DETECTION_BASE initialization
|
||||
-- ----------------------------------
|
||||
@ -20,46 +20,46 @@
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- 1.3) Obtain objects detected by DETECTION_BASE
|
||||
-- ----------------------------------------------
|
||||
-- DETECTION_BASE builds @{Set}s of objects detected. These @{Set#SET_BASE}s can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSets}().
|
||||
-- The method will return a list (table) of @{Set#SET_BASE} objects.
|
||||
-- DETECTION_BASE builds @{Set}s of objects detected. These @{Core.Set#SET_BASE}s can be retrieved using the method @{Functional.Detection#DETECTION_BASE.GetDetectedSets}().
|
||||
-- The method will return a list (table) of @{Core.Set#SET_BASE} objects.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Detection#DETECTION_AREAS} class, extends @{Detection#DETECTION_BASE}
|
||||
-- 2) @{Functional.Detection#DETECTION_AREAS} class, extends @{Functional.Detection#DETECTION_BASE}
|
||||
-- ===============================================================================
|
||||
-- The @{Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The @{Functional.Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Core.Set#SET_UNIT}s containing the @{Wrapper.Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- 2.1) Retrieve the Detected Unit sets and Detected Zones
|
||||
-- -------------------------------------------------------
|
||||
-- The DetectedUnitSets methods are implemented in @{Detection#DECTECTION_BASE} and the DetectedZones methods is implemented in @{Detection#DETECTION_AREAS}.
|
||||
-- The DetectedUnitSets methods are implemented in @{Functional.Detection#DECTECTION_BASE} and the DetectedZones methods is implemented in @{Functional.Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedUnitSets with the method @{Detection#DETECTION_BASE.GetDetectedSets}(). A table will be return of @{Set#SET_UNIT}s.
|
||||
-- To understand the amount of sets created, use the method @{Detection#DETECTION_BASE.GetDetectedSetCount}().
|
||||
-- If you want to obtain a specific set from the DetectedSets, use the method @{Detection#DETECTION_BASE.GetDetectedSet}() with a given index.
|
||||
-- Retrieve the DetectedUnitSets with the method @{Functional.Detection#DETECTION_BASE.GetDetectedSets}(). A table will be return of @{Core.Set#SET_UNIT}s.
|
||||
-- To understand the amount of sets created, use the method @{Functional.Detection#DETECTION_BASE.GetDetectedSetCount}().
|
||||
-- If you want to obtain a specific set from the DetectedSets, use the method @{Functional.Detection#DETECTION_BASE.GetDetectedSet}() with a given index.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- 1.4) Flare or Smoke detected units
|
||||
-- ----------------------------------
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
-- Use the methods @{Functional.Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Functional.Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- 1.5) Flare or Smoke detected zones
|
||||
-- ----------------------------------
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedZones}() or @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to flare or smoke the detected zones when a new detection has taken place.
|
||||
-- Use the methods @{Functional.Detection#DETECTION_AREAS.FlareDetectedZones}() or @{Functional.Detection#DETECTION_AREAS.SmokeDetectedZones}() to flare or smoke the detected zones when a new detection has taken place.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -77,12 +77,12 @@
|
||||
|
||||
--- DETECTION_BASE class
|
||||
-- @type DETECTION_BASE
|
||||
-- @field Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @field DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @field Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @field Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @field #DETECTION_BASE.DetectedObjects DetectedObjects The list of detected objects.
|
||||
-- @field #table DetectedObjectsIdentified Map of the DetectedObjects identified.
|
||||
-- @field #number DetectionRun
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
DETECTION_BASE = {
|
||||
ClassName = "DETECTION_BASE",
|
||||
DetectionSetGroup = nil,
|
||||
@ -104,8 +104,8 @@ DETECTION_BASE = {
|
||||
|
||||
--- DETECTION constructor.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @param DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @param Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @return #DETECTION_BASE self
|
||||
function DETECTION_BASE:New( DetectionSetGroup, DetectionRange )
|
||||
|
||||
@ -245,7 +245,7 @@ function DETECTION_BASE:GetDetectedObject( ObjectName )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the detected @{Set#SET_BASE}s.
|
||||
--- Get the detected @{Core.Set#SET_BASE}s.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @return #DETECTION_BASE.DetectedSets DetectedSets
|
||||
function DETECTION_BASE:GetDetectedSets()
|
||||
@ -266,7 +266,7 @@ end
|
||||
--- Get a SET of detected objects using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @return Set#SET_BASE
|
||||
-- @return Core.Set#SET_BASE
|
||||
function DETECTION_BASE:GetDetectedSet( Index )
|
||||
|
||||
local DetectionSet = self.DetectedSets[Index]
|
||||
@ -279,7 +279,7 @@ end
|
||||
|
||||
--- Get the detection Groups.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @return Group#GROUP
|
||||
-- @return Wrapper.Group#GROUP
|
||||
function DETECTION_BASE:GetDetectionSetGroup()
|
||||
|
||||
local DetectionSetGroup = self.DetectionSetGroup
|
||||
@ -313,7 +313,7 @@ function DETECTION_BASE:Schedule( DelayTime, RepeatInterval )
|
||||
end
|
||||
|
||||
|
||||
--- Form @{Set}s of detected @{Unit#UNIT}s in an array of @{Set#SET_BASE}s.
|
||||
--- Form @{Set}s of detected @{Wrapper.Unit#UNIT}s in an array of @{Core.Set#SET_BASE}s.
|
||||
-- @param #DETECTION_BASE self
|
||||
function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
self:F2( { SchedulerName } )
|
||||
@ -323,7 +323,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
|
||||
|
||||
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||
local DetectionGroup = DetectionGroupData -- Group#GROUP
|
||||
local DetectionGroup = DetectionGroupData -- Wrapper.Group#GROUP
|
||||
|
||||
if DetectionGroup:IsAlive() then
|
||||
|
||||
@ -339,7 +339,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
)
|
||||
|
||||
for DetectionDetectedTargetID, DetectionDetectedTarget in pairs( DetectionDetectedTargets ) do
|
||||
local DetectionObject = DetectionDetectedTarget.object -- DCSObject#Object
|
||||
local DetectionObject = DetectionDetectedTarget.object -- Dcs.DCSWrapper.Object#Object
|
||||
self:T2( DetectionObject )
|
||||
|
||||
if DetectionObject and DetectionObject:isExist() and DetectionObject.id_ < 50000000 then
|
||||
@ -393,9 +393,9 @@ end
|
||||
|
||||
--- DETECTION_AREAS class
|
||||
-- @type DETECTION_AREAS
|
||||
-- @field DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field #DETECTION_AREAS.DetectedAreas DetectedAreas A list of areas containing the set of @{Unit}s, @{Zone}s, the center @{Unit} within the zone, and ID of each area that was detected within a DetectionZoneRange.
|
||||
-- @extends Detection#DETECTION_BASE
|
||||
-- @extends Functional.Detection#DETECTION_BASE
|
||||
DETECTION_AREAS = {
|
||||
ClassName = "DETECTION_AREAS",
|
||||
DetectedAreas = { n = 0 },
|
||||
@ -406,21 +406,21 @@ DETECTION_AREAS = {
|
||||
-- @list <#DETECTION_AREAS.DetectedArea>
|
||||
|
||||
--- @type DETECTION_AREAS.DetectedArea
|
||||
-- @field Set#SET_UNIT Set -- The Set of Units in the detected area.
|
||||
-- @field Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||
-- @field Core.Set#SET_UNIT Set -- The Set of Units in the detected area.
|
||||
-- @field Core.Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||
-- @field #boolean Changed Documents if the detected area has changes.
|
||||
-- @field #table Changes A list of the changes reported on the detected area. (It is up to the user of the detected area to consume those changes).
|
||||
-- @field #number AreaID -- The identifier of the detected area.
|
||||
-- @field #boolean FriendliesNearBy Indicates if there are friendlies within the detected area.
|
||||
-- @field Unit#UNIT NearestFAC The nearest FAC near the Area.
|
||||
-- @field Wrapper.Unit#UNIT NearestFAC The nearest FAC near the Area.
|
||||
|
||||
|
||||
--- DETECTION_AREAS constructor.
|
||||
-- @param Detection#DETECTION_AREAS self
|
||||
-- @param Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @param DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @param DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @return Detection#DETECTION_AREAS self
|
||||
-- @param Functional.Detection#DETECTION_AREAS self
|
||||
-- @param Core.Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
||||
-- @param Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @param Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @return Functional.Detection#DETECTION_AREAS self
|
||||
function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRange )
|
||||
|
||||
-- Inherits from DETECTION_BASE
|
||||
@ -439,8 +439,8 @@ function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRa
|
||||
end
|
||||
|
||||
--- Add a detected @{#DETECTION_AREAS.DetectedArea}.
|
||||
-- @param Set#SET_UNIT Set -- The Set of Units in the detected area.
|
||||
-- @param Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||
-- @param Core.Set#SET_UNIT Set -- The Set of Units in the detected area.
|
||||
-- @param Core.Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||
-- @return #DETECTION_AREAS.DetectedArea DetectedArea
|
||||
function DETECTION_AREAS:AddDetectedArea( Set, Zone )
|
||||
local DetectedAreas = self:GetDetectedAreas()
|
||||
@ -487,10 +487,10 @@ function DETECTION_AREAS:GetDetectedAreaCount()
|
||||
return DetectedAreaCount
|
||||
end
|
||||
|
||||
--- Get the @{Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||
--- Get the @{Core.Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param #number Index
|
||||
-- @return Set#SET_UNIT DetectedSet
|
||||
-- @return Core.Set#SET_UNIT DetectedSet
|
||||
function DETECTION_AREAS:GetDetectedSet( Index )
|
||||
|
||||
local DetectedSetUnit = self.DetectedAreas[Index].Set
|
||||
@ -501,10 +501,10 @@ function DETECTION_AREAS:GetDetectedSet( Index )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the @{Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||
--- Get the @{Core.Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param #number Index
|
||||
-- @return Zone#ZONE_UNIT DetectedZone
|
||||
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
||||
function DETECTION_AREAS:GetDetectedZone( Index )
|
||||
|
||||
local DetectedZone = self.DetectedAreas[Index].Zone
|
||||
@ -517,11 +517,11 @@ end
|
||||
|
||||
--- Background worker function to determine if there are friendlies nearby ...
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param Unit#UNIT ReportUnit
|
||||
-- @param Wrapper.Unit#UNIT ReportUnit
|
||||
function DETECTION_AREAS:ReportFriendliesNearBy( ReportGroupData )
|
||||
self:F2()
|
||||
|
||||
local DetectedArea = ReportGroupData.DetectedArea -- Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedArea = ReportGroupData.DetectedArea -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedSet = ReportGroupData.DetectedArea.Set
|
||||
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
||||
local DetectedZoneUnit = DetectedZone.ZoneUNIT
|
||||
@ -537,15 +537,15 @@ function DETECTION_AREAS:ReportFriendliesNearBy( ReportGroupData )
|
||||
|
||||
}
|
||||
|
||||
--- @param DCSUnit#Unit FoundDCSUnit
|
||||
-- @param Group#GROUP ReportGroup
|
||||
--- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit
|
||||
-- @param Wrapper.Group#GROUP ReportGroup
|
||||
-- @param Set#SET_GROUP ReportSetGroup
|
||||
local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData )
|
||||
|
||||
local DetectedArea = ReportGroupData.DetectedArea -- Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedArea = ReportGroupData.DetectedArea -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedSet = ReportGroupData.DetectedArea.Set
|
||||
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
||||
local DetectedZoneUnit = DetectedZone.ZoneUNIT -- Unit#UNIT
|
||||
local DetectedZoneUnit = DetectedZone.ZoneUNIT -- Wrapper.Unit#UNIT
|
||||
local ReportSetGroup = ReportGroupData.ReportSetGroup
|
||||
|
||||
local EnemyCoalition = DetectedZoneUnit:GetCoalition()
|
||||
@ -588,7 +588,7 @@ function DETECTION_AREAS:CalculateThreatLevelA2G( DetectedArea )
|
||||
|
||||
local MaxThreatLevelA2G = 0
|
||||
for UnitName, UnitData in pairs( DetectedArea.Set:GetSet() ) do
|
||||
local ThreatUnit = UnitData -- Unit#UNIT
|
||||
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
local ThreatLevelA2G = ThreatUnit:GetThreatLevel()
|
||||
if ThreatLevelA2G > MaxThreatLevelA2G then
|
||||
MaxThreatLevelA2G = ThreatLevelA2G
|
||||
@ -603,7 +603,7 @@ end
|
||||
--- Find the nearest FAC of the DetectedArea.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param #DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Unit#UNIT The nearest FAC unit
|
||||
-- @return Wrapper.Unit#UNIT The nearest FAC unit
|
||||
function DETECTION_AREAS:NearestFAC( DetectedArea )
|
||||
|
||||
local NearestFAC = nil
|
||||
@ -611,7 +611,7 @@ function DETECTION_AREAS:NearestFAC( DetectedArea )
|
||||
|
||||
for FACGroupName, FACGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||
for FACUnit, FACUnitData in pairs( FACGroupData:GetUnits() ) do
|
||||
local FACUnit = FACUnitData -- Unit#UNIT
|
||||
local FACUnit = FACUnitData -- Wrapper.Unit#UNIT
|
||||
if FACUnit:IsActive() then
|
||||
local Vec3 = FACUnit:GetVec3()
|
||||
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
||||
@ -829,7 +829,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
-- Then search for a new center area unit within the set. Note that the new area unit candidate must be within the area range.
|
||||
for DetectedUnitName, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
||||
|
||||
local DetectedUnit = DetectedUnitData -- Unit#UNIT
|
||||
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||
local DetectedObject = self:GetDetectedObject( DetectedUnit.UnitName )
|
||||
|
||||
-- The DetectedObject can be nil when the DetectedUnit is not alive anymore or it is not in the DetectedObjects map.
|
||||
@ -859,7 +859,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
-- If a unit was not found in the set, remove it from the set. This may be added later to other existing or new sets.
|
||||
for DetectedUnitName, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
||||
|
||||
local DetectedUnit = DetectedUnitData -- Unit#UNIT
|
||||
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||
local DetectedObject = nil
|
||||
if DetectedUnit:IsAlive() then
|
||||
--self:E(DetectedUnit:GetName())
|
||||
@ -909,7 +909,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
if DetectedObject then
|
||||
|
||||
-- We found an unidentified unit outside of any existing detection area.
|
||||
local DetectedUnit = UNIT:FindByName( DetectedUnitName ) -- Unit#UNIT
|
||||
local DetectedUnit = UNIT:FindByName( DetectedUnitName ) -- Wrapper.Unit#UNIT
|
||||
|
||||
local AddedToDetectionArea = false
|
||||
|
||||
@ -959,7 +959,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
||||
DetectedZone.ZoneUNIT:SmokeRed()
|
||||
end
|
||||
DetectedSet:ForEachUnit(
|
||||
--- @param Unit#UNIT DetectedUnit
|
||||
--- @param Wrapper.Unit#UNIT DetectedUnit
|
||||
function( DetectedUnit )
|
||||
if DetectedUnit:IsAlive() then
|
||||
self:T( "Detected Set #" .. DetectedArea.AreaID .. ":" .. DetectedUnit:GetName() )
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
-- ============================
|
||||
-- Create a new SPAWN object with the @{#ESCORT.New} method:
|
||||
--
|
||||
-- * @{#ESCORT.New}: Creates a new ESCORT object from a @{Group#GROUP} for a @{Client#CLIENT}, with an optional briefing text.
|
||||
-- * @{#ESCORT.New}: Creates a new ESCORT object from a @{Wrapper.Group#GROUP} for a @{Wrapper.Client#CLIENT}, with an optional briefing text.
|
||||
--
|
||||
-- ESCORT initialization methods.
|
||||
-- ==============================
|
||||
@ -117,17 +117,17 @@
|
||||
|
||||
--- ESCORT class
|
||||
-- @type ESCORT
|
||||
-- @extends Base#BASE
|
||||
-- @field Client#CLIENT EscortClient
|
||||
-- @field Group#GROUP EscortGroup
|
||||
-- @extends Core.Base#BASE
|
||||
-- @field Wrapper.Client#CLIENT EscortClient
|
||||
-- @field Wrapper.Group#GROUP EscortGroup
|
||||
-- @field #string EscortName
|
||||
-- @field #ESCORT.MODE EscortMode The mode the escort is in.
|
||||
-- @field Scheduler#SCHEDULER FollowScheduler The instance of the SCHEDULER class.
|
||||
-- @field Core.Scheduler#SCHEDULER FollowScheduler The instance of the SCHEDULER class.
|
||||
-- @field #number FollowDistance The current follow distance.
|
||||
-- @field #boolean ReportTargets If true, nearby targets are reported.
|
||||
-- @Field DCSTypes#AI.Option.Air.val.ROE OptionROE Which ROE is set to the EscortGroup.
|
||||
-- @field DCSTypes#AI.Option.Air.val.REACTION_ON_THREAT OptionReactionOnThreat Which REACTION_ON_THREAT is set to the EscortGroup.
|
||||
-- @field Menu#MENU_CLIENT EscortMenuResumeMission
|
||||
-- @Field Dcs.DCSTypes#AI.Option.Air.val.ROE OptionROE Which ROE is set to the EscortGroup.
|
||||
-- @field Dcs.DCSTypes#AI.Option.Air.val.REACTION_ON_THREAT OptionReactionOnThreat Which REACTION_ON_THREAT is set to the EscortGroup.
|
||||
-- @field Core.Menu#MENU_CLIENT EscortMenuResumeMission
|
||||
ESCORT = {
|
||||
ClassName = "ESCORT",
|
||||
EscortName = nil, -- The Escort Name
|
||||
@ -161,8 +161,8 @@ ESCORT = {
|
||||
|
||||
--- ESCORT class constructor for an AI group
|
||||
-- @param #ESCORT self
|
||||
-- @param Client#CLIENT EscortClient The client escorted by the EscortGroup.
|
||||
-- @param Group#GROUP EscortGroup The group AI escorting the EscortClient.
|
||||
-- @param Wrapper.Client#CLIENT EscortClient The client escorted by the EscortGroup.
|
||||
-- @param Wrapper.Group#GROUP EscortGroup The group AI escorting the EscortClient.
|
||||
-- @param #string EscortName Name of the escort.
|
||||
-- @param #string EscortBriefing A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
||||
-- @return #ESCORT self
|
||||
@ -179,8 +179,8 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing )
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
self:F( { EscortClient, EscortGroup, EscortName } )
|
||||
|
||||
self.EscortClient = EscortClient -- Client#CLIENT
|
||||
self.EscortGroup = EscortGroup -- Group#GROUP
|
||||
self.EscortClient = EscortClient -- Wrapper.Client#CLIENT
|
||||
self.EscortGroup = EscortGroup -- Wrapper.Group#GROUP
|
||||
self.EscortName = EscortName
|
||||
self.EscortBriefing = EscortBriefing
|
||||
|
||||
@ -268,7 +268,7 @@ end
|
||||
--- Defines a menu slot to let the escort Join and Follow you at a certain distance.
|
||||
-- This menu will appear under **Navigation**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCSTypes#Distance Distance The distance in meters that the escort needs to follow the client.
|
||||
-- @param Dcs.DCSTypes#Distance Distance The distance in meters that the escort needs to follow the client.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuFollowAt( Distance )
|
||||
self:F(Distance)
|
||||
@ -293,8 +293,8 @@ end
|
||||
--- Defines a menu slot to let the escort hold at their current position and stay low with a specified height during a specified time in seconds.
|
||||
-- This menu will appear under **Hold position**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param Dcs.DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param Dcs.DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
||||
@ -355,8 +355,8 @@ end
|
||||
--- Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds.
|
||||
-- This menu will appear under **Navigation**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param Dcs.DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param Dcs.DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
||||
@ -416,8 +416,8 @@ end
|
||||
--- Defines a menu slot to let the escort scan for targets at a certain height for a certain time in seconds.
|
||||
-- This menu will appear under **Scan targets**.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param Dcs.DCSTypes#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.
|
||||
-- @param Dcs.DCSTypes#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.
|
||||
-- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat )
|
||||
@ -542,7 +542,7 @@ end
|
||||
-- This menu will appear under **Report targets**.
|
||||
-- Note that if a report targets menu is not specified, no targets will be detected by the escort, and the attack and assisted attack menus will not be displayed.
|
||||
-- @param #ESCORT self
|
||||
-- @param DCSTypes#Time Seconds Optional parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds.
|
||||
-- @param Dcs.DCSTypes#Time Seconds Optional parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds.
|
||||
-- @return #ESCORT
|
||||
function ESCORT:MenuReportTargets( Seconds )
|
||||
self:F( { Seconds } )
|
||||
@ -664,8 +664,8 @@ function ESCORT._HoldPosition( MenuParam )
|
||||
local EscortGroup = self.EscortGroup
|
||||
local EscortClient = self.EscortClient
|
||||
|
||||
local OrbitGroup = MenuParam.ParamOrbitGroup -- Group#GROUP
|
||||
local OrbitUnit = OrbitGroup:GetUnit(1) -- Unit#UNIT
|
||||
local OrbitGroup = MenuParam.ParamOrbitGroup -- Wrapper.Group#GROUP
|
||||
local OrbitUnit = OrbitGroup:GetUnit(1) -- Wrapper.Unit#UNIT
|
||||
local OrbitHeight = MenuParam.ParamHeight
|
||||
local OrbitSeconds = MenuParam.ParamSeconds -- Not implemented yet
|
||||
|
||||
@ -714,10 +714,10 @@ function ESCORT._JoinUpAndFollow( MenuParam )
|
||||
end
|
||||
|
||||
--- JoinsUp and Follows a CLIENT.
|
||||
-- @param Escort#ESCORT self
|
||||
-- @param Group#GROUP EscortGroup
|
||||
-- @param Client#CLIENT EscortClient
|
||||
-- @param DCSTypes#Distance Distance
|
||||
-- @param Functional.Escort#ESCORT self
|
||||
-- @param Wrapper.Group#GROUP EscortGroup
|
||||
-- @param Wrapper.Client#CLIENT EscortClient
|
||||
-- @param Dcs.DCSTypes#Distance Distance
|
||||
function ESCORT:JoinUpAndFollow( EscortGroup, EscortClient, Distance )
|
||||
self:F( { EscortGroup, EscortClient, Distance } )
|
||||
|
||||
@ -832,7 +832,7 @@ function ESCORT._ScanTargets( MenuParam )
|
||||
|
||||
end
|
||||
|
||||
--- @param Group#GROUP EscortGroup
|
||||
--- @param Wrapper.Group#GROUP EscortGroup
|
||||
function _Resume( EscortGroup )
|
||||
env.info( '_Resume' )
|
||||
|
||||
@ -851,7 +851,7 @@ function ESCORT._AttackTarget( MenuParam )
|
||||
local EscortGroup = self.EscortGroup
|
||||
|
||||
local EscortClient = self.EscortClient
|
||||
local AttackUnit = MenuParam.ParamUnit -- Unit#UNIT
|
||||
local AttackUnit = MenuParam.ParamUnit -- Wrapper.Unit#UNIT
|
||||
|
||||
self.FollowScheduler:Stop()
|
||||
|
||||
@ -892,7 +892,7 @@ function ESCORT._AssistTarget( MenuParam )
|
||||
local EscortGroup = self.EscortGroup
|
||||
local EscortClient = self.EscortClient
|
||||
local EscortGroupAttack = MenuParam.ParamEscortGroup
|
||||
local AttackUnit = MenuParam.ParamUnit -- Unit#UNIT
|
||||
local AttackUnit = MenuParam.ParamUnit -- Wrapper.Unit#UNIT
|
||||
|
||||
self.FollowScheduler:Stop()
|
||||
|
||||
@ -981,7 +981,7 @@ end
|
||||
function ESCORT:RegisterRoute()
|
||||
self:F()
|
||||
|
||||
local EscortGroup = self.EscortGroup -- Group#GROUP
|
||||
local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP
|
||||
|
||||
local TaskPoints = EscortGroup:GetTaskRoute()
|
||||
|
||||
@ -990,7 +990,7 @@ function ESCORT:RegisterRoute()
|
||||
return TaskPoints
|
||||
end
|
||||
|
||||
--- @param Escort#ESCORT self
|
||||
--- @param Functional.Escort#ESCORT self
|
||||
function ESCORT:_FollowScheduler()
|
||||
self:F( { self.FollowDistance } )
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{MissileTrainer#MISSILETRAINER} class, extends @{Base#BASE}
|
||||
-- 1) @{Functional.MissileTrainer#MISSILETRAINER} class, extends @{Core.Base#BASE}
|
||||
-- ===============================================================
|
||||
-- The @{#MISSILETRAINER} class uses the DCS world messaging system to be alerted of any missiles fired, and when a missile would hit your aircraft,
|
||||
-- the class will destroy the missile within a certain range, to avoid damage to your aircraft.
|
||||
@ -83,8 +83,8 @@
|
||||
|
||||
--- The MISSILETRAINER class
|
||||
-- @type MISSILETRAINER
|
||||
-- @field Set#SET_CLIENT DBClients
|
||||
-- @extends Base#BASE
|
||||
-- @field Core.Set#SET_CLIENT DBClients
|
||||
-- @extends Core.Base#BASE
|
||||
MISSILETRAINER = {
|
||||
ClassName = "MISSILETRAINER",
|
||||
TrackingMissiles = {},
|
||||
@ -191,7 +191,7 @@ function MISSILETRAINER:New( Distance, Briefing )
|
||||
|
||||
|
||||
-- self.DB:ForEachClient(
|
||||
-- --- @param Client#CLIENT Client
|
||||
-- --- @param Wrapper.Client#CLIENT Client
|
||||
-- function( Client )
|
||||
--
|
||||
-- ... actions ...
|
||||
@ -449,7 +449,7 @@ end
|
||||
|
||||
--- Detects if an SA site was shot with an anti radiation missile. In this case, take evasive actions based on the skill level set within the ME.
|
||||
-- @param #MISSILETRAINER self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function MISSILETRAINER:_EventShot( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
--- The Scoring class
|
||||
-- @type SCORING
|
||||
-- @field Players A collection of the current players that have joined the game.
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
SCORING = {
|
||||
ClassName = "SCORING",
|
||||
ClassID = 0,
|
||||
@ -100,7 +100,7 @@ end
|
||||
|
||||
--- Track DEAD or CRASH events for the scoring.
|
||||
-- @param #SCORING self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SCORING:_EventOnDeadOrCrash( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
@ -265,8 +265,8 @@ end
|
||||
|
||||
--- Registers Scores the players completing a Mission Task.
|
||||
-- @param #SCORING self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Unit#UNIT PlayerUnit
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit
|
||||
-- @param #string Text
|
||||
-- @param #number Score
|
||||
function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
@ -300,8 +300,8 @@ end
|
||||
|
||||
--- Registers Mission Scores for possible multiple players that contributed in the Mission.
|
||||
-- @param #SCORING self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Unit#UNIT PlayerUnit
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit
|
||||
-- @param #string Text
|
||||
-- @param #number Score
|
||||
function SCORING:_AddMissionScore( Mission, Text, Score )
|
||||
@ -330,7 +330,7 @@ end
|
||||
|
||||
--- Handles the OnHit event for the scoring.
|
||||
-- @param #SCORING self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SCORING:_EventOnHit( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
--- The SEAD class
|
||||
-- @type SEAD
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
SEAD = {
|
||||
ClassName = "SEAD",
|
||||
TargetSkill = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- This module contains the SPAWN class.
|
||||
--
|
||||
-- 1) @{Spawn#SPAWN} class, extends @{Base#BASE}
|
||||
-- 1) @{Functional.Spawn#SPAWN} class, extends @{Core.Base#BASE}
|
||||
-- =============================================
|
||||
-- The @{#SPAWN} class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
|
||||
-- For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the *"Spawn Template"* of the SPAWN object.
|
||||
@ -195,7 +195,7 @@
|
||||
|
||||
--- SPAWN Class
|
||||
-- @type SPAWN
|
||||
-- @extends Base#BASE
|
||||
-- @extends Core.Base#BASE
|
||||
-- @field ClassName
|
||||
-- @field #string SpawnTemplatePrefix
|
||||
-- @field #string SpawnAliasPrefix
|
||||
@ -211,7 +211,7 @@ SPAWN = {
|
||||
}
|
||||
|
||||
--- @type SPAWN.SpawnZoneTable
|
||||
-- @list <Zone#ZONE_BASE> SpawnZone
|
||||
-- @list <Core.Zone#ZONE_BASE> SpawnZone
|
||||
|
||||
|
||||
--- Creates the main object to spawn a @{Group} defined in the DCS ME.
|
||||
@ -350,8 +350,8 @@ end
|
||||
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{UNIT}s position within the group between a given outer and inner radius.
|
||||
-- @param DCSTypes#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
|
||||
-- @param DCSTypes#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||
-- @return #SPAWN
|
||||
-- @usage
|
||||
-- -- NATO helicopters engaging in the battle field.
|
||||
@ -572,7 +572,7 @@ end
|
||||
--- Will spawn a group based on the internal index.
|
||||
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
||||
-- @param #SPAWN self
|
||||
-- @return Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
function SPAWN:Spawn()
|
||||
self:F( { self.SpawnTemplatePrefix, self.SpawnIndex, self.AliveUnits } )
|
||||
|
||||
@ -583,7 +583,7 @@ end
|
||||
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
||||
-- @param #SPAWN self
|
||||
-- @param #string SpawnIndex The index of the group to be spawned.
|
||||
-- @return Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
function SPAWN:ReSpawn( SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, SpawnIndex } )
|
||||
|
||||
@ -607,7 +607,7 @@ end
|
||||
-- Uses @{DATABASE} global object defined in MOOSE.
|
||||
-- @param #SPAWN self
|
||||
-- @param #string SpawnIndex The index of the group to be spawned.
|
||||
-- @return Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
-- @return Wrapper.Group#GROUP The group that was spawned. You can use this group for further actions.
|
||||
function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
self:F2( { SpawnTemplatePrefix = self.SpawnTemplatePrefix, SpawnIndex = SpawnIndex, AliveUnits = self.AliveUnits, SpawnMaxGroups = self.SpawnMaxGroups } )
|
||||
|
||||
@ -714,7 +714,7 @@ end
|
||||
|
||||
--- Allows to place a CallFunction hook when a new group spawns.
|
||||
-- The provided method will be called when a new group is spawned, including its given parameters.
|
||||
-- The first parameter of the SpawnFunction is the @{Group#GROUP} that was spawned.
|
||||
-- The first parameter of the SpawnFunction is the @{Wrapper.Group#GROUP} that was spawned.
|
||||
-- @param #SPAWN self
|
||||
-- @param #function SpawnCallBackFunction The function to be called when a group spawns.
|
||||
-- @param SpawnFunctionArguments A random amount of arguments to be provided to the function when the group spawns.
|
||||
@ -748,9 +748,9 @@ end
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param DCSTypes#Vec3 Vec3 The Vec3 coordinates where to spawn the group.
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 coordinates where to spawn the group.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Group#GROUP that was spawned.
|
||||
-- @return Wrapper.Group#GROUP that was spawned.
|
||||
-- @return #nil Nothing was spawned.
|
||||
function SPAWN:SpawnFromVec3( Vec3, SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, Vec3, SpawnIndex } )
|
||||
@ -806,9 +806,9 @@ end
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param DCSTypes#Vec2 Vec2 The Vec2 coordinates where to spawn the group.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The Vec2 coordinates where to spawn the group.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Group#GROUP that was spawned.
|
||||
-- @return Wrapper.Group#GROUP that was spawned.
|
||||
-- @return #nil Nothing was spawned.
|
||||
function SPAWN:SpawnFromVec2( Vec2, SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, Vec2, SpawnIndex } )
|
||||
@ -822,9 +822,9 @@ end
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param Unit#UNIT HostUnit The air or ground unit dropping or unloading the group.
|
||||
-- @param Wrapper.Unit#UNIT HostUnit The air or ground unit dropping or unloading the group.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Group#GROUP that was spawned.
|
||||
-- @return Wrapper.Group#GROUP that was spawned.
|
||||
-- @return #nil Nothing was spawned.
|
||||
function SPAWN:SpawnFromUnit( HostUnit, SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, HostUnit, SpawnIndex } )
|
||||
@ -839,9 +839,9 @@ end
|
||||
--- Will spawn a group from a hosting static. This method is mostly advisable to be used if you want to simulate spawning from buldings and structures (static buildings).
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param Static#STATIC HostStatic The static dropping or unloading the group.
|
||||
-- @param Wrapper.Static#STATIC HostStatic The static dropping or unloading the group.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Group#GROUP that was spawned.
|
||||
-- @return Wrapper.Group#GROUP that was spawned.
|
||||
-- @return #nil Nothing was spawned.
|
||||
function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, HostStatic, SpawnIndex } )
|
||||
@ -854,14 +854,14 @@ function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
||||
end
|
||||
|
||||
--- Will spawn a Group within a given @{Zone}.
|
||||
-- The @{Zone} can be of any type derived from @{Zone#ZONE_BASE}.
|
||||
-- The @{Zone} can be of any type derived from @{Core.Zone#ZONE_BASE}.
|
||||
-- Once the @{Group} is spawned within the zone, the @{Group} will continue on its route.
|
||||
-- The **first waypoint** (where the group is spawned) is replaced with the zone location coordinates.
|
||||
-- @param #SPAWN self
|
||||
-- @param Zone#ZONE Zone The zone where the group is to be spawned.
|
||||
-- @param Core.Zone#ZONE Zone The zone where the group is to be spawned.
|
||||
-- @param #boolean RandomizeGroup (optional) Randomization of the @{Group} position in the zone.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Group#GROUP that was spawned.
|
||||
-- @return Wrapper.Group#GROUP that was spawned.
|
||||
-- @return #nil when nothing was spawned.
|
||||
function SPAWN:SpawnInZone( Zone, RandomizeGroup, SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, Zone, RandomizeGroup, SpawnIndex } )
|
||||
@ -920,7 +920,7 @@ end
|
||||
|
||||
--- Will find the first alive @{Group} it has spawned, and return the alive @{Group} object and the first Index where the first alive @{Group} object has been found.
|
||||
-- @param #SPAWN self
|
||||
-- @return Group#GROUP, #number The @{Group} object found, the new Index where the group was found.
|
||||
-- @return Wrapper.Group#GROUP, #number The @{Group} object found, the new Index where the group was found.
|
||||
-- @return #nil, #nil When no group is found, #nil is returned.
|
||||
-- @usage
|
||||
-- -- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
||||
@ -946,7 +946,7 @@ end
|
||||
--- Will find the next alive @{Group} object from a given Index, and return a reference to the alive @{Group} object and the next Index where the alive @{Group} has been found.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number SpawnIndexStart A Index holding the start position to search from. This method can also be used to find the first alive @{Group} object from the given Index.
|
||||
-- @return Group#GROUP, #number The next alive @{Group} object found, the next Index where the next alive @{Group} object was found.
|
||||
-- @return Wrapper.Group#GROUP, #number The next alive @{Group} object found, the next Index where the next alive @{Group} object was found.
|
||||
-- @return #nil, #nil When no alive @{Group} object is found from the start Index position, #nil is returned.
|
||||
-- @usage
|
||||
-- -- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
||||
@ -971,7 +971,7 @@ end
|
||||
|
||||
--- Will find the last alive @{Group} object, and will return a reference to the last live @{Group} object and the last Index where the last alive @{Group} object has been found.
|
||||
-- @param #SPAWN self
|
||||
-- @return Group#GROUP, #number The last alive @{Group} object found, the last Index where the last alive @{Group} object was found.
|
||||
-- @return Wrapper.Group#GROUP, #number The last alive @{Group} object found, the last Index where the last alive @{Group} object was found.
|
||||
-- @return #nil, #nil When no alive @{Group} object is found, #nil is returned.
|
||||
-- @usage
|
||||
-- -- Find the last alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
||||
@ -1002,7 +1002,7 @@ end
|
||||
-- If no index is given, it will return the first group in the list.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number SpawnIndex The index of the group to return.
|
||||
-- @return Group#GROUP self
|
||||
-- @return Wrapper.Group#GROUP self
|
||||
function SPAWN:GetGroupFromIndex( SpawnIndex )
|
||||
self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnIndex } )
|
||||
|
||||
@ -1022,7 +1022,7 @@ end
|
||||
-- The method will search for a #-mark, and will return the index behind the #-mark of the DCSUnit.
|
||||
-- It will return nil of no prefix was found.
|
||||
-- @param #SPAWN self
|
||||
-- @param DCSUnit#Unit DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @return #string The prefix
|
||||
-- @return #nil Nothing found
|
||||
function SPAWN:_GetGroupIndexFromDCSUnit( DCSUnit )
|
||||
@ -1044,7 +1044,7 @@ end
|
||||
-- The method will search for a #-mark, and will return the text before the #-mark.
|
||||
-- It will return nil of no prefix was found.
|
||||
-- @param #SPAWN self
|
||||
-- @param DCSUnit#UNIT DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @param Dcs.DCSWrapper.Unit#UNIT DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @return #string The prefix
|
||||
-- @return #nil Nothing found
|
||||
function SPAWN:_GetPrefixFromDCSUnit( DCSUnit )
|
||||
@ -1064,8 +1064,8 @@ end
|
||||
|
||||
--- Return the group within the SpawnGroups collection with input a DCSUnit.
|
||||
-- @param #SPAWN self
|
||||
-- @param DCSUnit#Unit DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @return Group#GROUP The Group
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit DCSUnit The @{DCSUnit} to be searched.
|
||||
-- @return Wrapper.Group#GROUP The Group
|
||||
-- @return #nil Nothing found
|
||||
function SPAWN:_GetGroupFromDCSUnit( DCSUnit )
|
||||
self:F3( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, DCSUnit } )
|
||||
@ -1404,7 +1404,7 @@ end
|
||||
-- TODO Need to delete this... _DATABASE does this now ...
|
||||
|
||||
--- @param #SPAWN self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SPAWN:_OnBirth( Event )
|
||||
|
||||
if timer.getTime0() < timer.getAbsTime() then
|
||||
@ -1424,7 +1424,7 @@ end
|
||||
-- @todo Need to delete this... _DATABASE does this now ...
|
||||
|
||||
--- @param #SPAWN self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function SPAWN:_OnDeadOrCrash( Event )
|
||||
self:F( self.SpawnTemplatePrefix, Event )
|
||||
|
||||
@ -1526,7 +1526,7 @@ function SPAWN:_SpawnCleanUpScheduler()
|
||||
|
||||
for UnitID, UnitData in pairs( SpawnUnits ) do
|
||||
|
||||
local SpawnUnit = UnitData -- Unit#UNIT
|
||||
local SpawnUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
local SpawnUnitName = SpawnUnit:GetName()
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ Include.File( "Core/Database" )
|
||||
Include.File( "Core/Set" )
|
||||
Include.File( "Core/Point" )
|
||||
Include.File( "Core/Message" )
|
||||
Include.File( "Core/StateMachine" )
|
||||
|
||||
--- Wrapper Classes
|
||||
Include.File( "Wrapper/Object" )
|
||||
@ -40,6 +39,7 @@ Include.File( "Functional/Detection" )
|
||||
Include.File( "Functional/AIBalancer" )
|
||||
|
||||
--- Fsm Classes
|
||||
Include.File( "Fsm/Fsm" )
|
||||
Include.File( "Fsm/Process" )
|
||||
Include.File( "Fsm/Process_JTAC" )
|
||||
Include.File( "Fsm/Patrol" )
|
||||
|
||||
@ -41,7 +41,7 @@ end
|
||||
--- The COMMANDCENTER class
|
||||
-- @type COMMANDCENTER
|
||||
-- @field Wrapper.Group#GROUP HQ
|
||||
-- @field Dcs.DCSCoalitionObject#coalition CommandCenterCoalition
|
||||
-- @field Dcs.DCSCoalitionWrapper.Object#coalition CommandCenterCoalition
|
||||
-- @list<Tasking.Mission#MISSION> Missions
|
||||
-- @extends Core.Base#BASE
|
||||
COMMANDCENTER = {
|
||||
|
||||
@ -2,37 +2,37 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{DetectionManager#DETECTION_MANAGER} class, extends @{Base#BASE}
|
||||
-- 1) @{Tasking.DetectionManager#DETECTION_MANAGER} class, extends @{Core.Base#BASE}
|
||||
-- ====================================================================
|
||||
-- The @{DetectionManager#DETECTION_MANAGER} class defines the core functions to report detected objects to groups.
|
||||
-- The @{Tasking.DetectionManager#DETECTION_MANAGER} class defines the core functions to report detected objects to groups.
|
||||
-- Reportings can be done in several manners, and it is up to the derived classes if DETECTION_MANAGER to model the reporting behaviour.
|
||||
--
|
||||
-- 1.1) DETECTION_MANAGER constructor:
|
||||
-- -----------------------------------
|
||||
-- * @{DetectionManager#DETECTION_MANAGER.New}(): Create a new DETECTION_MANAGER instance.
|
||||
-- * @{Tasking.DetectionManager#DETECTION_MANAGER.New}(): Create a new DETECTION_MANAGER instance.
|
||||
--
|
||||
-- 1.2) DETECTION_MANAGER reporting:
|
||||
-- ---------------------------------
|
||||
-- Derived DETECTION_MANAGER classes will reports detected units using the method @{DetectionManager#DETECTION_MANAGER.ReportDetected}(). This method implements polymorphic behaviour.
|
||||
-- Derived DETECTION_MANAGER classes will reports detected units using the method @{Tasking.DetectionManager#DETECTION_MANAGER.ReportDetected}(). This method implements polymorphic behaviour.
|
||||
--
|
||||
-- The time interval in seconds of the reporting can be changed using the methods @{DetectionManager#DETECTION_MANAGER.SetReportInterval}().
|
||||
-- To control how long a reporting message is displayed, use @{DetectionManager#DETECTION_MANAGER.SetReportDisplayTime}().
|
||||
-- Derived classes need to implement the method @{DetectionManager#DETECTION_MANAGER.GetReportDisplayTime}() to use the correct display time for displayed messages during a report.
|
||||
-- The time interval in seconds of the reporting can be changed using the methods @{Tasking.DetectionManager#DETECTION_MANAGER.SetReportInterval}().
|
||||
-- To control how long a reporting message is displayed, use @{Tasking.DetectionManager#DETECTION_MANAGER.SetReportDisplayTime}().
|
||||
-- Derived classes need to implement the method @{Tasking.DetectionManager#DETECTION_MANAGER.GetReportDisplayTime}() to use the correct display time for displayed messages during a report.
|
||||
--
|
||||
-- Reporting can be started and stopped using the methods @{DetectionManager#DETECTION_MANAGER.StartReporting}() and @{DetectionManager#DETECTION_MANAGER.StopReporting}() respectively.
|
||||
-- If an ad-hoc report is requested, use the method @{DetectionManager#DETECTION_MANAGER#ReportNow}().
|
||||
-- Reporting can be started and stopped using the methods @{Tasking.DetectionManager#DETECTION_MANAGER.StartReporting}() and @{Tasking.DetectionManager#DETECTION_MANAGER.StopReporting}() respectively.
|
||||
-- If an ad-hoc report is requested, use the method @{Tasking.DetectionManager#DETECTION_MANAGER#ReportNow}().
|
||||
--
|
||||
-- The default reporting interval is every 60 seconds. The reporting messages are displayed 15 seconds.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{DetectionManager#DETECTION_REPORTING} class, extends @{DetectionManager#DETECTION_MANAGER}
|
||||
-- 2) @{Tasking.DetectionManager#DETECTION_REPORTING} class, extends @{Tasking.DetectionManager#DETECTION_MANAGER}
|
||||
-- =========================================================================================
|
||||
-- The @{DetectionManager#DETECTION_REPORTING} class implements detected units reporting. Reporting can be controlled using the reporting methods available in the @{DetectionManager#DETECTION_MANAGER} class.
|
||||
-- The @{Tasking.DetectionManager#DETECTION_REPORTING} class implements detected units reporting. Reporting can be controlled using the reporting methods available in the @{Tasking.DetectionManager#DETECTION_MANAGER} class.
|
||||
--
|
||||
-- 2.1) DETECTION_REPORTING constructor:
|
||||
-- -------------------------------
|
||||
-- The @{DetectionManager#DETECTION_REPORTING.New}() method creates a new DETECTION_REPORTING instance.
|
||||
-- The @{Tasking.DetectionManager#DETECTION_REPORTING.New}() method creates a new DETECTION_REPORTING instance.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -64,7 +64,7 @@ do -- DETECTION MANAGER
|
||||
--- DETECTION_MANAGER class.
|
||||
-- @type DETECTION_MANAGER
|
||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
||||
-- @field Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @extends Base#BASE
|
||||
DETECTION_MANAGER = {
|
||||
ClassName = "DETECTION_MANAGER",
|
||||
@ -75,12 +75,12 @@ do -- DETECTION MANAGER
|
||||
--- FAC constructor.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Detection#DETECTION_BASE Detection
|
||||
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||
-- @return #DETECTION_MANAGER self
|
||||
function DETECTION_MANAGER:New( SetGroup, Detection )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- Detection#DETECTION_MANAGER
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- Functional.Detection#DETECTION_MANAGER
|
||||
|
||||
self.SetGroup = SetGroup
|
||||
self.Detection = Detection
|
||||
@ -125,7 +125,7 @@ do -- DETECTION MANAGER
|
||||
|
||||
--- Reports the detected items to the @{Set#SET_GROUP}.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
-- @param Detection#DETECTION_BASE Detection
|
||||
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||
-- @return #DETECTION_MANAGER self
|
||||
function DETECTION_MANAGER:ReportDetected( Detection )
|
||||
self:F2()
|
||||
@ -148,7 +148,7 @@ do -- DETECTION MANAGER
|
||||
return self
|
||||
end
|
||||
|
||||
--- Report the detected @{Unit#UNIT}s detected within the @{Detection#DETECTION_BASE} object to the @{Set#SET_GROUP}s.
|
||||
--- Report the detected @{Wrapper.Unit#UNIT}s detected within the @{Functional.Detection#DETECTION_BASE} object to the @{Set#SET_GROUP}s.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
function DETECTION_MANAGER:_FacScheduler( SchedulerName )
|
||||
self:F2( { SchedulerName } )
|
||||
@ -156,7 +156,7 @@ do -- DETECTION MANAGER
|
||||
return self:ProcessDetected( self.Detection )
|
||||
|
||||
-- self.SetGroup:ForEachGroup(
|
||||
-- --- @param Group#GROUP Group
|
||||
-- --- @param Wrapper.Group#GROUP Group
|
||||
-- function( Group )
|
||||
-- if Group:IsAlive() then
|
||||
-- return self:ProcessDetected( self.Detection )
|
||||
@ -175,7 +175,7 @@ do -- DETECTION_REPORTING
|
||||
--- DETECTION_REPORTING class.
|
||||
-- @type DETECTION_REPORTING
|
||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
||||
-- @field Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @extends #DETECTION_MANAGER
|
||||
DETECTION_REPORTING = {
|
||||
ClassName = "DETECTION_REPORTING",
|
||||
@ -185,7 +185,7 @@ do -- DETECTION_REPORTING
|
||||
--- DETECTION_REPORTING constructor.
|
||||
-- @param #DETECTION_REPORTING self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Detection#DETECTION_AREAS Detection
|
||||
-- @param Functional.Detection#DETECTION_AREAS Detection
|
||||
-- @return #DETECTION_REPORTING self
|
||||
function DETECTION_REPORTING:New( SetGroup, Detection )
|
||||
|
||||
@ -198,7 +198,7 @@ do -- DETECTION_REPORTING
|
||||
|
||||
--- Creates a string of the detected items in a @{Detection}.
|
||||
-- @param #DETECTION_MANAGER self
|
||||
-- @param Set#SET_UNIT DetectedSet The detected Set created by the @{Detection#DETECTION_BASE} object.
|
||||
-- @param Set#SET_UNIT DetectedSet The detected Set created by the @{Functional.Detection#DETECTION_BASE} object.
|
||||
-- @return #DETECTION_MANAGER self
|
||||
function DETECTION_REPORTING:GetDetectedItemsText( DetectedSet )
|
||||
self:F2()
|
||||
@ -207,7 +207,7 @@ do -- DETECTION_REPORTING
|
||||
local UnitTypes = {}
|
||||
|
||||
for DetectedUnitID, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
||||
local DetectedUnit = DetectedUnitData -- Unit#UNIT
|
||||
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||
if DetectedUnit:IsAlive() then
|
||||
local UnitType = DetectedUnit:GetTypeName()
|
||||
|
||||
@ -230,8 +230,8 @@ do -- DETECTION_REPORTING
|
||||
|
||||
--- Reports the detected items to the @{Set#SET_GROUP}.
|
||||
-- @param #DETECTION_REPORTING self
|
||||
-- @param Group#GROUP Group The @{Group} object to where the report needs to go.
|
||||
-- @param Detection#DETECTION_AREAS Detection The detection created by the @{Detection#DETECTION_BASE} object.
|
||||
-- @param Wrapper.Group#GROUP Group The @{Group} object to where the report needs to go.
|
||||
-- @param Functional.Detection#DETECTION_AREAS Detection The detection created by the @{Functional.Detection#DETECTION_BASE} object.
|
||||
-- @return #boolean Return true if you want the reporting to continue... false will cancel the reporting loop.
|
||||
function DETECTION_REPORTING:ProcessDetected( Group, Detection )
|
||||
self:F2( Group )
|
||||
@ -239,7 +239,7 @@ do -- DETECTION_REPORTING
|
||||
self:E( Group )
|
||||
local DetectedMsg = {}
|
||||
for DetectedAreaID, DetectedAreaData in pairs( Detection:GetDetectedAreas() ) do
|
||||
local DetectedArea = DetectedAreaData -- Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedArea = DetectedAreaData -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
||||
DetectedMsg[#DetectedMsg+1] = " - Group #" .. DetectedAreaID .. ": " .. self:GetDetectedItemsText( DetectedArea.Set )
|
||||
end
|
||||
local FACGroup = Detection:GetDetectionGroups()
|
||||
@ -255,10 +255,10 @@ do -- DETECTION_DISPATCHER
|
||||
--- DETECTION_DISPATCHER class.
|
||||
-- @type DETECTION_DISPATCHER
|
||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
||||
-- @field Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @field Mission#MISSION Mission
|
||||
-- @field Group#GROUP CommandCenter
|
||||
-- @extends DetectionManager#DETECTION_MANAGER
|
||||
-- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects.
|
||||
-- @field Tasking.Mission#MISSION Mission
|
||||
-- @field Wrapper.Group#GROUP CommandCenter
|
||||
-- @extends Tasking.DetectionManager#DETECTION_MANAGER
|
||||
DETECTION_DISPATCHER = {
|
||||
ClassName = "DETECTION_DISPATCHER",
|
||||
Mission = nil,
|
||||
@ -270,7 +270,7 @@ do -- DETECTION_DISPATCHER
|
||||
--- DETECTION_DISPATCHER constructor.
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Set#SET_GROUP SetGroup
|
||||
-- @param Detection#DETECTION_BASE Detection
|
||||
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||
-- @return #DETECTION_DISPATCHER self
|
||||
function DETECTION_DISPATCHER:New( Mission, CommandCenter, SetGroup, Detection )
|
||||
|
||||
@ -288,7 +288,7 @@ do -- DETECTION_DISPATCHER
|
||||
|
||||
--- Creates a SEAD task when there are targets for it.
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Set#SET_UNIT TargetSetUnit: The target set of units.
|
||||
-- @return #nil If there are no targets to be set.
|
||||
function DETECTION_DISPATCHER:EvaluateSEAD( DetectedArea )
|
||||
@ -316,8 +316,8 @@ do -- DETECTION_DISPATCHER
|
||||
|
||||
--- Creates a CAS task when there are targets for it.
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Task#TASK_BASE
|
||||
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Tasking.Task#TASK_BASE
|
||||
function DETECTION_DISPATCHER:EvaluateCAS( DetectedArea )
|
||||
self:F( { DetectedArea.AreaID } )
|
||||
|
||||
@ -344,8 +344,8 @@ do -- DETECTION_DISPATCHER
|
||||
|
||||
--- Creates a BAI task when there are targets for it.
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Task#TASK_BASE
|
||||
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Tasking.Task#TASK_BASE
|
||||
function DETECTION_DISPATCHER:EvaluateBAI( DetectedArea, FriendlyCoalition )
|
||||
self:F( { DetectedArea.AreaID } )
|
||||
|
||||
@ -373,10 +373,10 @@ do -- DETECTION_DISPATCHER
|
||||
--- Evaluates the removal of the Task from the Mission.
|
||||
-- Can only occur when the DetectedArea is Changed AND the state of the Task is "Planned".
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Task#TASK_BASE Task
|
||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Task#TASK_BASE
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Tasking.Task#TASK_BASE Task
|
||||
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||
-- @return Tasking.Task#TASK_BASE
|
||||
function DETECTION_DISPATCHER:EvaluateRemoveTask( Mission, Task, DetectedArea )
|
||||
|
||||
if Task then
|
||||
@ -393,7 +393,7 @@ do -- DETECTION_DISPATCHER
|
||||
|
||||
--- Assigns tasks in relation to the detected items to the @{Set#SET_GROUP}.
|
||||
-- @param #DETECTION_DISPATCHER self
|
||||
-- @param Detection#DETECTION_AREAS Detection The detection created by the @{Detection#DETECTION_AREAS} object.
|
||||
-- @param Functional.Detection#DETECTION_AREAS Detection The detection created by the @{Functional.Detection#DETECTION_AREAS} object.
|
||||
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
||||
function DETECTION_DISPATCHER:ProcessDetected( Detection )
|
||||
self:F2()
|
||||
@ -407,7 +407,7 @@ do -- DETECTION_DISPATCHER
|
||||
--- First we need to the detected targets.
|
||||
for DetectedAreaID, DetectedAreaData in ipairs( Detection:GetDetectedAreas() ) do
|
||||
|
||||
local DetectedArea = DetectedAreaData -- Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedArea = DetectedAreaData -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
||||
local DetectedSet = DetectedArea.Set
|
||||
local DetectedZone = DetectedArea.Zone
|
||||
self:E( { "Targets in DetectedArea", DetectedArea.AreaID, DetectedSet:Count(), tostring( DetectedArea ) } )
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
--- The MISSION class
|
||||
-- @type MISSION
|
||||
-- @field #MISSION.Clients _Clients
|
||||
-- @field Menu#MENU_COALITION MissionMenu
|
||||
-- @field Core.Menu#MENU_COALITION MissionMenu
|
||||
-- @field #string MissionBriefing
|
||||
-- @extends Core.StateMachine#STATEMACHINE
|
||||
-- @extends Core.StateMachine#FSM
|
||||
MISSION = {
|
||||
ClassName = "MISSION",
|
||||
Name = "",
|
||||
@ -36,11 +36,11 @@ MISSION = {
|
||||
-- @param #string MissionName is the name of the mission. This name will be used to reference the status of each mission by the players.
|
||||
-- @param #string MissionPriority is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.
|
||||
-- @param #string MissionBriefing is a string indicating the mission briefing to be shown when a player joins a @{CLIENT}.
|
||||
-- @param DCSCoalitionObject#coalition MissionCoalition is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
|
||||
-- @param Dcs.DCSCoalitionWrapper.Object#coalition MissionCoalition is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...
|
||||
-- @return #MISSION self
|
||||
function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE:New() ) -- Core.StateMachine#STATEMACHINE
|
||||
local self = BASE:Inherit( self, FSM:New() ) -- Core.StateMachine#FSM
|
||||
|
||||
self:SetStartState( "Idle" )
|
||||
|
||||
@ -128,13 +128,13 @@ end
|
||||
|
||||
--- Sets the Assigned Task menu.
|
||||
-- @param #MISSION self
|
||||
-- @param Task#TASK_BASE Task
|
||||
-- @param Tasking.Task#TASK_BASE Task
|
||||
-- @param #string MenuText The menu text.
|
||||
-- @return #MISSION self
|
||||
function MISSION:SetAssignedMenu( Task )
|
||||
|
||||
for _, Task in pairs( self.Tasks ) do
|
||||
local Task = Task -- Task#TASK_BASE
|
||||
local Task = Task -- Tasking.Task#TASK_BASE
|
||||
Task:RemoveMenu()
|
||||
Task:SetAssignedMenu()
|
||||
end
|
||||
@ -143,7 +143,7 @@ end
|
||||
|
||||
--- Removes a Task menu.
|
||||
-- @param #MISSION self
|
||||
-- @param Task#TASK_BASE Task
|
||||
-- @param Tasking.Task#TASK_BASE Task
|
||||
-- @return #MISSION self
|
||||
function MISSION:RemoveTaskMenu( Task )
|
||||
|
||||
@ -153,8 +153,8 @@ end
|
||||
|
||||
--- Gets the mission menu for the coalition.
|
||||
-- @param #MISSION self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @return Menu#MENU_COALITION self
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @return Core.Menu#MENU_COALITION self
|
||||
function MISSION:GetMissionMenu( TaskGroup )
|
||||
|
||||
local CommandCenter = self:GetCommandCenter()
|
||||
@ -179,7 +179,7 @@ end
|
||||
|
||||
--- Get the TASK identified by the TaskNumber from the Mission. This function is useful in GoalFunctions.
|
||||
-- @param #string TaskName The Name of the @{Task} within the @{Mission}.
|
||||
-- @return Task#TASK_BASE The Task
|
||||
-- @return Tasking.Task#TASK_BASE The Task
|
||||
-- @return #nil Returns nil if no task was found.
|
||||
function MISSION:GetTask( TaskName )
|
||||
self:F( { TaskName } )
|
||||
@ -192,8 +192,8 @@ end
|
||||
-- Note that there can be multiple @{Task}s registered to be completed.
|
||||
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
|
||||
-- @param #MISSION self
|
||||
-- @param Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @return Task#TASK_BASE The task added.
|
||||
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @return Tasking.Task#TASK_BASE The task added.
|
||||
function MISSION:AddTask( Task )
|
||||
|
||||
local TaskName = Task:GetTaskName()
|
||||
@ -209,7 +209,7 @@ end
|
||||
-- Note that there can be multiple @{Task}s registered to be completed.
|
||||
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
|
||||
-- @param #MISSION self
|
||||
-- @param Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @return #nil The cleaned Task reference.
|
||||
function MISSION:RemoveTask( Task )
|
||||
|
||||
@ -231,8 +231,8 @@ end
|
||||
|
||||
--- Return the next @{Task} ID to be completed within the @{Mission}.
|
||||
-- @param #MISSION self
|
||||
-- @param Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @return Task#TASK_BASE The task added.
|
||||
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
|
||||
-- @return Tasking.Task#TASK_BASE The task added.
|
||||
function MISSION:GetNextTaskID( Task )
|
||||
|
||||
local TaskName = Task:GetTaskName()
|
||||
@ -513,7 +513,7 @@ function MISSIONSCHEDULER.Scheduler()
|
||||
|
||||
for ClientID, ClientData in pairs( Mission._Clients ) do
|
||||
|
||||
local Client = ClientData -- Client#CLIENT
|
||||
local Client = ClientData -- Wrapper.Client#CLIENT
|
||||
|
||||
if Client:IsAlive() then
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- This module contains the TASK_BASE class.
|
||||
--
|
||||
-- 1) @{#TASK_BASE} class, extends @{Base#BASE}
|
||||
-- 1) @{#TASK_BASE} class, extends @{Core.Base#BASE}
|
||||
-- ============================================
|
||||
-- 1.1) The @{#TASK_BASE} class implements the methods for task orchestration within MOOSE.
|
||||
-- ----------------------------------------------------------------------------------------
|
||||
@ -51,11 +51,11 @@
|
||||
|
||||
--- The TASK_BASE class
|
||||
-- @type TASK_BASE
|
||||
-- @field Scheduler#SCHEDULER TaskScheduler
|
||||
-- @field Mission#MISSION Mission
|
||||
-- @field Core.Scheduler#SCHEDULER TaskScheduler
|
||||
-- @field Tasking.Mission#MISSION Mission
|
||||
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
|
||||
-- @field Core.StateMachine#STATEMACHINE_TEMPLATE FsmTemplate
|
||||
-- @extends Core.StateMachine#STATEMACHINE_TASK
|
||||
-- @field Core.StateMachine#FSM_TEMPLATE FsmTemplate
|
||||
-- @extends Core.StateMachine#FSM_TASK
|
||||
TASK_BASE = {
|
||||
ClassName = "TASK_BASE",
|
||||
TaskScheduler = nil,
|
||||
@ -70,14 +70,14 @@ TASK_BASE = {
|
||||
|
||||
--- Instantiates a new TASK_BASE. Should never be used. Interface Class.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Mission#MISSION Mission The mission wherein the Task is registered.
|
||||
-- @param Set#SET_GROUP SetGroupAssign The set of groups for which the Task can be assigned.
|
||||
-- @param Tasking.Mission#MISSION Mission The mission wherein the Task is registered.
|
||||
-- @param Core.Set#SET_GROUP SetGroupAssign The set of groups for which the Task can be assigned.
|
||||
-- @param #string TaskName The name of the Task
|
||||
-- @param #string TaskType The type of the Task
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
|
||||
|
||||
local self = BASE:Inherit( self, STATEMACHINE_TASK:New() ) -- Core.StateMachine#STATEMACHINE_TASK
|
||||
local self = BASE:Inherit( self, FSM_TASK:New() ) -- Core.StateMachine#FSM_TASK
|
||||
|
||||
self:SetStartState( "Planned" )
|
||||
self:AddTransition( "Planned", "Assign", "Assigned" )
|
||||
@ -98,7 +98,7 @@ function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
|
||||
|
||||
self.TaskBriefing = "You are invited for the task: " .. self.TaskName .. "."
|
||||
|
||||
self.FsmTemplate = self.FsmTemplate or STATEMACHINE_TEMPLATE:New( "MAIN" )
|
||||
self.FsmTemplate = self.FsmTemplate or FSM_TEMPLATE:New( "MAIN" )
|
||||
|
||||
-- Handle the birth of new planes within the assigned set.
|
||||
self:EventOnPlayerEnterUnit(
|
||||
@ -142,7 +142,7 @@ end
|
||||
|
||||
--- Assign the @{Task}to a @{Group}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @return #TASK_BASE
|
||||
function TASK_BASE:AssignToGroup( TaskGroup )
|
||||
self:F2( TaskGroup:GetName() )
|
||||
@ -156,7 +156,7 @@ function TASK_BASE:AssignToGroup( TaskGroup )
|
||||
|
||||
local TaskUnits = TaskGroup:GetUnits()
|
||||
for UnitID, UnitData in pairs( TaskUnits ) do
|
||||
local TaskUnit = UnitData -- Unit#UNIT
|
||||
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
local PlayerName = TaskUnit:GetPlayerName()
|
||||
self:E(PlayerName)
|
||||
if PlayerName ~= nil or PlayerName ~= "" then
|
||||
@ -179,13 +179,13 @@ end
|
||||
|
||||
--- Assign the @{Task} to an alive @{Unit}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:AssignToUnit( TaskUnit )
|
||||
self:F( TaskUnit:GetName() )
|
||||
|
||||
-- Assign a new FsmUnit to TaskUnit.
|
||||
local FsmUnit = self:SetStateMachine( TaskUnit, STATEMACHINE_PROCESS:New( self:GetFsmTemplate(), TaskUnit, self ) ) -- Core.StateMachine#STATEMACHINE_PROCESS
|
||||
local FsmUnit = self:SetStateMachine( TaskUnit, FSM_PROCESS:New( self:GetFsmTemplate(), TaskUnit, self ) ) -- Core.StateMachine#FSM_PROCESS
|
||||
self:E({"Address FsmUnit", tostring( FsmUnit ) } )
|
||||
|
||||
-- Set the events
|
||||
@ -204,7 +204,7 @@ end
|
||||
|
||||
--- UnAssign the @{Task} from an alive @{Unit}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:UnAssignFromUnit( TaskUnitName )
|
||||
self:F( TaskUnitName )
|
||||
@ -254,7 +254,7 @@ end
|
||||
|
||||
--- Returns if the @{Task} is assigned to the Group.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @return #boolean
|
||||
function TASK_BASE:IsAssignedToGroup( TaskGroup )
|
||||
|
||||
@ -304,7 +304,7 @@ end
|
||||
|
||||
--- Set the planned menu option of the @{Task}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @param #string MenuText The menu text.
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:SetPlannedMenuForGroup( TaskGroup, MenuText )
|
||||
@ -322,7 +322,7 @@ end
|
||||
|
||||
--- Set the assigned menu options of the @{Task}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:SetAssignedMenuForGroup( TaskGroup )
|
||||
self:E( TaskGroup:GetName() )
|
||||
@ -340,7 +340,7 @@ end
|
||||
|
||||
--- Remove the menu option of the @{Task} for a @{Group}.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Group#GROUP TaskGroup
|
||||
-- @param Wrapper.Group#GROUP TaskGroup
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:RemoveMenuForGroup( TaskGroup )
|
||||
|
||||
@ -416,7 +416,7 @@ end
|
||||
|
||||
--- Add a FiniteStateMachine to @{Task} with key @{Unit}
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:SetStateMachine( TaskUnit, Fsm )
|
||||
local TaskUnitName = TaskUnit:GetName()
|
||||
@ -452,7 +452,7 @@ end
|
||||
--- Register a potential new assignment for a new spawned @{Unit}.
|
||||
-- Tasks only get assigned if there are players in it.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:_EventAssignUnit( Event )
|
||||
if Event.IniUnit then
|
||||
@ -481,7 +481,7 @@ end
|
||||
-- * and he is on an airbase and on the ground, the process for him will just continue to work, he can switch airplanes, and take-off again.
|
||||
-- This is important to model the change from plane types for a player during mission assignment.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:_EventPlayerLeaveUnit( Event )
|
||||
self:F( Event )
|
||||
@ -510,7 +510,7 @@ end
|
||||
--- UnAssigns a @{Unit} that is left by a player, crashed, dead, ....
|
||||
-- There are only assignments if there are players in it.
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
-- @return #TASK_BASE self
|
||||
function TASK_BASE:_EventDead( Event )
|
||||
self:F( Event )
|
||||
@ -688,12 +688,12 @@ end
|
||||
|
||||
|
||||
--- Adds a score for the TASK to be achieved.
|
||||
-- @param #STATEMACHINE_TEMPLATE self
|
||||
-- @param #FSM_TEMPLATE self
|
||||
-- @param #string TaskStatus is the status of the TASK when the score needs to be given.
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #STATEMACHINE_TEMPLATE self
|
||||
function STATEMACHINE_TEMPLATE:AddScoreTask( TaskStatus, ScoreText, Score )
|
||||
-- @return #FSM_TEMPLATE self
|
||||
function FSM_TEMPLATE:AddScoreTask( TaskStatus, ScoreText, Score )
|
||||
self:F2( { TaskStatus, ScoreText, Score } )
|
||||
|
||||
self.Scores[TaskStatus] = self.Scores[TaskStatus] or {}
|
||||
@ -708,7 +708,7 @@ end
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function TASK_BASE:onenterAssigned( Event, From, To )
|
||||
|
||||
self:E("Assigned")
|
||||
@ -723,7 +723,7 @@ end
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function TASK_BASE:onenterSuccess( Event, From, To )
|
||||
|
||||
self:E("Success")
|
||||
@ -732,12 +732,12 @@ end
|
||||
|
||||
--- StateMachine callback function for a TASK
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function TASK_BASE:OnFailed( TaskUnit, Fsm, Event, From, To )
|
||||
|
||||
self:E( { "Failed for unit ", TaskUnit:GetName(), TaskUnit:GetPlayerName() } )
|
||||
@ -753,12 +753,12 @@ end
|
||||
|
||||
--- StateMachine callback function for a TASK
|
||||
-- @param #TASK_BASE self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function TASK_BASE:onstatechange( Event, From, To )
|
||||
|
||||
if self:IsTrace() then
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
--- TASK2_MENU_CLIENT class
|
||||
-- @type TASK2_MENU_CLIENT
|
||||
-- @field Unit#UNIT TaskUnit
|
||||
-- @field Set#SET_UNIT TargetSet
|
||||
-- @field Menu#MENU_CLIENT_COMMAND MenuTask
|
||||
-- @field Wrapper.Unit#UNIT TaskUnit
|
||||
-- @field Core.Set#SET_UNIT TargetSet
|
||||
-- @field Core.Menu#MENU_CLIENT_COMMAND MenuTask
|
||||
-- @extends Task2#TASK2
|
||||
TASK2_MENU_CLIENT = {
|
||||
ClassName = "TASK2_MENU_CLIENT",
|
||||
@ -14,8 +14,8 @@ TASK2_MENU_CLIENT = {
|
||||
|
||||
--- Creates a new MENU handling machine.
|
||||
-- @param #TASK2_MENU_CLIENT self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @param #string MenuText The text of the menu item.
|
||||
-- @return #TASK2_MENU_CLIENT self
|
||||
function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText )
|
||||
@ -25,7 +25,7 @@ function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText )
|
||||
|
||||
self.MenuText = MenuText
|
||||
|
||||
self.Fsm = STATEMACHINE_TASK:New( self, {
|
||||
self.Fsm = FSM_TASK:New( self, {
|
||||
initial = 'Unassigned',
|
||||
events = {
|
||||
{ name = 'Menu', from = 'Unassigned', to = 'AwaitingMenu' },
|
||||
@ -47,7 +47,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a TASK2
|
||||
-- @param #TASK2_MENU_CLIENT self
|
||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
||||
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
@ -71,7 +71,7 @@ end
|
||||
|
||||
--- StateMachine callback function for a TASK2
|
||||
-- @param #TASK2_MENU_CLIENT self
|
||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
||||
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
--- (AI) (SP) (MP) Tasking for Air to Ground Processes.
|
||||
--
|
||||
-- 1) @{#TASK_A2G} class, extends @{Task#TASK_BASE}
|
||||
-- 1) @{#TASK_A2G} class, extends @{Tasking.Task#TASK_BASE}
|
||||
-- =================================================
|
||||
-- The @{#TASK_A2G} class defines a CAS or BAI task of a @{Set} of Target Units,
|
||||
-- located at a Target Zone, based on the tasking capabilities defined in @{Task#TASK_BASE}.
|
||||
-- The TASK_A2G is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
||||
-- located at a Target Zone, based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||
-- The TASK_A2G is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
-- * **None**: Start of the process
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Group#GROUP}. Upon Assigned, the sub-process @{Process_Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
|
||||
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
|
||||
--
|
||||
@ -30,7 +30,7 @@ do -- TASK_A2G
|
||||
|
||||
--- Instantiates a new TASK_A2G.
|
||||
-- @param #TASK_A2G self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Set#SET_GROUP SetGroup The set of groups for which the Task can be assigned.
|
||||
-- @param #string TaskName The name of the Task.
|
||||
-- @param #string TaskType BAI or CAS
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{AIBalancer#AIBALANCER} class, extends @{Base#BASE}
|
||||
-- 1) @{Functional.AIBalancer#AIBALANCER} class, extends @{Core.Base#BASE}
|
||||
-- =======================================================
|
||||
-- The @{AIBalancer#AIBALANCER} class controls the dynamic spawning of AI GROUPS depending on a SET_CLIENT.
|
||||
-- The @{Functional.AIBalancer#AIBALANCER} class controls the dynamic spawning of AI GROUPS depending on a SET_CLIENT.
|
||||
-- There will be as many AI GROUPS spawned as there at CLIENTS in SET_CLIENT not spawned.
|
||||
-- The AIBalancer uses the @{PatrolZone#PATROLZONE} class to make AI patrol an zone until the fuel treshold is reached.
|
||||
-- The AIBalancer uses the @{PatrolCore.Zone#PATROLZONE} class to make AI patrol an zone until the fuel treshold is reached.
|
||||
--
|
||||
-- 1.1) AIBALANCER construction method:
|
||||
-- ------------------------------------
|
||||
@ -18,12 +18,12 @@
|
||||
-- ---------------------------------------
|
||||
-- You can configure to have the AI to return to:
|
||||
--
|
||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||
--
|
||||
-- 1.3) AIBALANCER allows AI to patrol specific zones:
|
||||
-- ---------------------------------------------------
|
||||
-- Use @{AIBalancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
|
||||
-- Use @{Functional.AIBalancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -67,14 +67,14 @@
|
||||
|
||||
--- AIBALANCER class
|
||||
-- @type AIBALANCER
|
||||
-- @field Set#SET_CLIENT SetClient
|
||||
-- @field Spawn#SPAWN SpawnAI
|
||||
-- @field Core.Set#SET_CLIENT SetClient
|
||||
-- @field Functional.Spawn#SPAWN SpawnAI
|
||||
-- @field #boolean ToNearestAirbase
|
||||
-- @field Set#SET_AIRBASE ReturnAirbaseSet
|
||||
-- @field DCSTypes#Distance ReturnTresholdRange
|
||||
-- @field Core.Set#SET_AIRBASE ReturnAirbaseSet
|
||||
-- @field Dcs.DCSTypes#Distance ReturnTresholdRange
|
||||
-- @field #boolean ToHomeAirbase
|
||||
-- @field PatrolZone#PATROLZONE PatrolZone
|
||||
-- @extends Base#BASE
|
||||
-- @field PatrolCore.Zone#PATROLZONE PatrolZone
|
||||
-- @extends Core.Base#BASE
|
||||
AIBALANCER = {
|
||||
ClassName = "AIBALANCER",
|
||||
PatrolZones = {},
|
||||
@ -121,10 +121,10 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
--- Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
||||
-- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param Core.Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Core.Set#SET_AIRBASE}s to evaluate where to return to.
|
||||
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||
|
||||
self.ToNearestAirbase = true
|
||||
@ -132,9 +132,9 @@ function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseS
|
||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||
end
|
||||
|
||||
--- Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
--- Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
-- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}.
|
||||
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||
|
||||
self.ToHomeAirbase = true
|
||||
@ -143,8 +143,8 @@ end
|
||||
|
||||
--- Let the AI patrol a @{Zone} with a given Speed range and Altitude range.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param PatrolZone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||
-- @return PatrolZone#PATROLZONE self
|
||||
-- @param PatrolCore.Zone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||
-- @return PatrolCore.Zone#PATROLZONE self
|
||||
function AIBALANCER:SetPatrolZone( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
|
||||
|
||||
self.PatrolZone = PATROLZONE:New(
|
||||
@ -159,7 +159,7 @@ end
|
||||
|
||||
--- Get the @{PatrolZone} object assigned by the @{AIBalancer} object.
|
||||
-- @param #AIBALANCER self
|
||||
-- @return PatrolZone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||
-- @return PatrolCore.Zone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||
function AIBALANCER:GetPatrolZone()
|
||||
|
||||
return self.PatrolZone
|
||||
@ -171,7 +171,7 @@ end
|
||||
function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
|
||||
self.SetClient:ForEachClient(
|
||||
--- @param Client#CLIENT Client
|
||||
--- @param Wrapper.Client#CLIENT Client
|
||||
function( Client )
|
||||
local ClientAIAliveState = Client:GetState( self, 'AIAlive' )
|
||||
self:T( ClientAIAliveState )
|
||||
@ -179,7 +179,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
if ClientAIAliveState == true then
|
||||
Client:SetState( self, 'AIAlive', false )
|
||||
|
||||
local AIGroup = self.AIGroups[Client.UnitName] -- Group#GROUP
|
||||
local AIGroup = self.AIGroups[Client.UnitName] -- Wrapper.Group#GROUP
|
||||
|
||||
-- local PatrolZone = Client:GetState( self, "PatrolZone" )
|
||||
-- if PatrolZone then
|
||||
@ -200,7 +200,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
self:E( RangeZone )
|
||||
|
||||
_DATABASE:ForEachPlayer(
|
||||
--- @param Unit#UNIT RangeTestUnit
|
||||
--- @param Wrapper.Unit#UNIT RangeTestUnit
|
||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||
@ -213,7 +213,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
end,
|
||||
|
||||
--- @param Zone#ZONE_RADIUS RangeZone
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function( RangeZone, AIGroup, PlayerInRange )
|
||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||
if PlayerInRange.Value == false then
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
--- This module contains the TASK_PICKUP classes.
|
||||
--
|
||||
-- 1) @{#TASK_PICKUP} class, extends @{Task#TASK_BASE}
|
||||
-- 1) @{#TASK_PICKUP} class, extends @{Tasking.Task#TASK_BASE}
|
||||
-- ===================================================
|
||||
-- The @{#TASK_PICKUP} class defines a pickup task of a @{Set} of @{CARGO} objects defined within the mission.
|
||||
-- based on the tasking capabilities defined in @{Task#TASK_BASE}.
|
||||
-- The TASK_PICKUP is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
||||
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||
-- The TASK_PICKUP is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
-- * **None**: Start of the process
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Group#GROUP}. Upon Assigned, the sub-process @{Process_Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
|
||||
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
|
||||
--
|
||||
@ -23,14 +23,14 @@ do -- TASK_PICKUP
|
||||
|
||||
--- The TASK_PICKUP class
|
||||
-- @type TASK_PICKUP
|
||||
-- @extends Task#TASK_BASE
|
||||
-- @extends Tasking.Task#TASK_BASE
|
||||
TASK_PICKUP = {
|
||||
ClassName = "TASK_PICKUP",
|
||||
}
|
||||
|
||||
--- Instantiates a new TASK_PICKUP.
|
||||
-- @param #TASK_PICKUP self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Set#SET_GROUP AssignedSetGroup The set of groups for which the Task can be assigned.
|
||||
-- @param #string TaskName The name of the Task.
|
||||
-- @param #string TaskType BAI or CAS
|
||||
@ -62,7 +62,7 @@ do -- TASK_PICKUP
|
||||
|
||||
--- Assign the @{Task} to a @{Unit}.
|
||||
-- @param #TASK_PICKUP self
|
||||
-- @param Unit#UNIT TaskUnit
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
-- @return #TASK_PICKUP self
|
||||
function TASK_PICKUP:AssignToUnit( TaskUnit )
|
||||
self:F( TaskUnit:GetName() )
|
||||
@ -70,7 +70,7 @@ do -- TASK_PICKUP
|
||||
local ProcessAssign = self:AddProcess( TaskUnit, PROCESS_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
|
||||
local ProcessPickup = self:AddProcess( TaskUnit, PROCESS_PICKUP:New( self, self.TaskType, TaskUnit ) )
|
||||
|
||||
local Process = self:AddStateMachine( TaskUnit, STATEMACHINE_TASK:New( self, TaskUnit, {
|
||||
local Process = self:AddStateMachine( TaskUnit, FSM_TASK:New( self, TaskUnit, {
|
||||
initial = 'None',
|
||||
events = {
|
||||
{ name = 'Next', from = 'None', to = 'Planned' },
|
||||
@ -98,7 +98,7 @@ do -- TASK_PICKUP
|
||||
|
||||
--- StateMachine callback function for a TASK
|
||||
-- @param #TASK_PICKUP self
|
||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
||||
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
--- This module contains the TASK_SEAD classes.
|
||||
--
|
||||
-- 1) @{#TASK_SEAD} class, extends @{Task#TASK_BASE}
|
||||
-- 1) @{#TASK_SEAD} class, extends @{Tasking.Task#TASK_BASE}
|
||||
-- =================================================
|
||||
-- The @{#TASK_SEAD} class defines a SEAD task for a @{Set} of Target Units, located at a Target Zone,
|
||||
-- based on the tasking capabilities defined in @{Task#TASK_BASE}.
|
||||
-- The TASK_SEAD is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
||||
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||
-- The TASK_SEAD is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
-- * **None**: Start of the process
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Group#GROUP}. Upon Assigned, the sub-process @{Process_Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task.
|
||||
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#PROCESS_ROUTE} is started to route the active Units in the Group to the attack zone.
|
||||
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
|
||||
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
|
||||
--
|
||||
@ -32,7 +32,7 @@ do -- TASK_SEAD
|
||||
|
||||
--- Instantiates a new TASK_SEAD.
|
||||
-- @param #TASK_SEAD self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Set#SET_GROUP SetGroup The set of groups for which the Task can be assigned.
|
||||
-- @param #string TaskName The name of the Task.
|
||||
-- @param Set#SET_UNIT UnitSetTargets
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Airbase#AIRBASE} class, extends @{Positionable#POSITIONABLE}
|
||||
-- 1) @{Wrapper.Airbase#AIRBASE} class, extends @{Wrapper.Positionable#POSITIONABLE}
|
||||
-- =================================================================
|
||||
-- The @{AIRBASE} class is a wrapper class to handle the DCS Airbase objects:
|
||||
--
|
||||
@ -33,7 +33,7 @@
|
||||
-- ---------------------
|
||||
-- The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method.
|
||||
-- To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call,
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method @{DCSAirbase#Airbase.getName}()
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method @{Dcs.DCSWrapper.Airbase#Airbase.getName}()
|
||||
-- is implemented in the AIRBASE class as @{#AIRBASE.GetName}().
|
||||
--
|
||||
-- More functions will be added
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
--- The AIRBASE class
|
||||
-- @type AIRBASE
|
||||
-- @extends Positionable#POSITIONABLE
|
||||
-- @extends Wrapper.Positionable#POSITIONABLE
|
||||
AIRBASE = {
|
||||
ClassName="AIRBASE",
|
||||
CategoryName = {
|
||||
@ -64,7 +64,7 @@ AIRBASE = {
|
||||
--- Create a new AIRBASE from DCSAirbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string AirbaseName The name of the airbase.
|
||||
-- @return Airbase#AIRBASE
|
||||
-- @return Wrapper.Airbase#AIRBASE
|
||||
function AIRBASE:Register( AirbaseName )
|
||||
|
||||
local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) )
|
||||
@ -76,8 +76,8 @@ end
|
||||
|
||||
--- Finds a AIRBASE from the _DATABASE using a DCSAirbase object.
|
||||
-- @param #AIRBASE self
|
||||
-- @param DCSAirbase#Airbase DCSAirbase An existing DCS Airbase object reference.
|
||||
-- @return Airbase#AIRBASE self
|
||||
-- @param Dcs.DCSWrapper.Airbase#Airbase DCSAirbase An existing DCS Airbase object reference.
|
||||
-- @return Wrapper.Airbase#AIRBASE self
|
||||
function AIRBASE:Find( DCSAirbase )
|
||||
|
||||
local AirbaseName = DCSAirbase:getName()
|
||||
@ -88,7 +88,7 @@ end
|
||||
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string AirbaseName The Airbase Name.
|
||||
-- @return Airbase#AIRBASE self
|
||||
-- @return Wrapper.Airbase#AIRBASE self
|
||||
function AIRBASE:FindByName( AirbaseName )
|
||||
|
||||
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
--- This module contains the CLIENT class.
|
||||
--
|
||||
-- 1) @{Client#CLIENT} class, extends @{Unit#UNIT}
|
||||
-- 1) @{Wrapper.Client#CLIENT} class, extends @{Wrapper.Unit#UNIT}
|
||||
-- ===============================================
|
||||
-- Clients are those **Units** defined within the Mission Editor that have the skillset defined as __Client__ or __Player__.
|
||||
-- Note that clients are NOT the same as Units, they are NOT necessarily alive.
|
||||
-- The @{Client#CLIENT} class is a wrapper class to handle the DCS Unit objects that have the skillset defined as __Client__ or __Player__:
|
||||
-- The @{Wrapper.Client#CLIENT} class is a wrapper class to handle the DCS Unit objects that have the skillset defined as __Client__ or __Player__:
|
||||
--
|
||||
-- * Wraps the DCS Unit objects with skill level set to Player or Client.
|
||||
-- * Support all DCS Unit APIs.
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
--- The CLIENT class
|
||||
-- @type CLIENT
|
||||
-- @extends Unit#UNIT
|
||||
-- @extends Wrapper.Unit#UNIT
|
||||
CLIENT = {
|
||||
ONBOARDSIDE = {
|
||||
NONE = 0,
|
||||
@ -259,7 +259,7 @@ end
|
||||
--- Return the DCSGroup of a Client.
|
||||
-- This function is modified to deal with a couple of bugs in DCS 1.5.3
|
||||
-- @param #CLIENT self
|
||||
-- @return DCSGroup#Group
|
||||
-- @return Dcs.DCSWrapper.Group#Group
|
||||
function CLIENT:GetDCSGroup()
|
||||
self:F3()
|
||||
|
||||
@ -333,10 +333,10 @@ function CLIENT:GetDCSGroup()
|
||||
end
|
||||
|
||||
|
||||
-- TODO: Check DCSTypes#Group.ID
|
||||
-- TODO: Check Dcs.DCSTypes#Group.ID
|
||||
--- Get the group ID of the client.
|
||||
-- @param #CLIENT self
|
||||
-- @return DCSTypes#Group.ID
|
||||
-- @return Dcs.DCSTypes#Group.ID
|
||||
function CLIENT:GetClientGroupID()
|
||||
|
||||
local ClientGroup = self:GetDCSGroup()
|
||||
@ -359,7 +359,7 @@ end
|
||||
|
||||
--- Returns the UNIT of the CLIENT.
|
||||
-- @param #CLIENT self
|
||||
-- @return Unit#UNIT
|
||||
-- @return Wrapper.Unit#UNIT
|
||||
function CLIENT:GetClientGroupUnit()
|
||||
self:F2()
|
||||
|
||||
@ -375,7 +375,7 @@ end
|
||||
|
||||
--- Returns the DCSUnit of the CLIENT.
|
||||
-- @param #CLIENT self
|
||||
-- @return DCSTypes#Unit
|
||||
-- @return Dcs.DCSTypes#Unit
|
||||
function CLIENT:GetClientGroupDCSUnit()
|
||||
self:F2()
|
||||
|
||||
@ -396,8 +396,8 @@ function CLIENT:IsTransport()
|
||||
return self.ClientTransport
|
||||
end
|
||||
|
||||
--- Shows the @{Cargo#CARGO} contained within the CLIENT to the player as a message.
|
||||
-- The @{Cargo#CARGO} is shown using the @{Message#MESSAGE} distribution system.
|
||||
--- Shows the @{Fsm.Cargo#CARGO} contained within the CLIENT to the player as a message.
|
||||
-- The @{Fsm.Cargo#CARGO} is shown using the @{Core.Message#MESSAGE} distribution system.
|
||||
-- @param #CLIENT self
|
||||
function CLIENT:ShowCargo()
|
||||
self:F()
|
||||
@ -430,7 +430,7 @@ end
|
||||
-- @param #string Message is the text describing the message.
|
||||
-- @param #number MessageDuration is the duration in seconds that the Message should be displayed.
|
||||
-- @param #string MessageCategory is the category of the message (the title).
|
||||
-- @param #number MessageInterval is the interval in seconds between the display of the @{Message#MESSAGE} when the CLIENT is in the air.
|
||||
-- @param #number MessageInterval is the interval in seconds between the display of the @{Core.Message#MESSAGE} when the CLIENT is in the air.
|
||||
-- @param #string MessageID is the identifier of the message when displayed with intervals.
|
||||
function CLIENT:Message( Message, MessageDuration, MessageCategory, MessageInterval, MessageID )
|
||||
self:F( { Message, MessageDuration, MessageCategory, MessageInterval } )
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- This module contains the CONTROLLABLE class.
|
||||
--
|
||||
-- 1) @{Controllable#CONTROLLABLE} class, extends @{Positionable#POSITIONABLE}
|
||||
-- 1) @{Wrapper.Controllable#CONTROLLABLE} class, extends @{Wrapper.Positionable#POSITIONABLE}
|
||||
-- ===========================================================
|
||||
-- The @{Controllable#CONTROLLABLE} class is a wrapper class to handle the DCS Controllable objects:
|
||||
-- The @{Wrapper.Controllable#CONTROLLABLE} class is a wrapper class to handle the DCS Controllable objects:
|
||||
--
|
||||
-- * Support all DCS Controllable APIs.
|
||||
-- * Enhance with Controllable specific APIs not in the DCS Controllable API set.
|
||||
@ -18,7 +18,7 @@
|
||||
-- 1.2) CONTROLLABLE task methods
|
||||
-- ------------------------------
|
||||
-- Several controllable task methods are available that help you to prepare tasks.
|
||||
-- These methods return a string consisting of the task description, which can then be given to either a @{Controllable#CONTROLLABLE.PushTask} or @{Controllable#SetTask} method to assign the task to the CONTROLLABLE.
|
||||
-- These methods return a string consisting of the task description, which can then be given to either a @{Wrapper.Controllable#CONTROLLABLE.PushTask} or @{Wrapper.Controllable#SetTask} method to assign the task to the CONTROLLABLE.
|
||||
-- Tasks are specific for the category of the CONTROLLABLE, more specific, for AIR, GROUND or AIR and GROUND.
|
||||
-- Each task description where applicable indicates for which controllable category the task is valid.
|
||||
-- There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.
|
||||
@ -44,7 +44,7 @@
|
||||
-- * @{#CONTROLLABLE.TaskHold}: (GROUND) Hold ground controllable from moving.
|
||||
-- * @{#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the controllable.
|
||||
-- * @{#CONTROLLABLE.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- * @{#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the controllable at a @{Zone#ZONE_RADIUS).
|
||||
-- * @{#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).
|
||||
-- * @{#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the controllable at a specified alititude.
|
||||
-- * @{#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- * @{#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||
@ -128,7 +128,7 @@
|
||||
--- The CONTROLLABLE class
|
||||
-- @type CONTROLLABLE
|
||||
-- @extends Wrapper.Positionable#POSITIONABLE
|
||||
-- @field DCSControllable#Controllable DCSControllable The DCS controllable class.
|
||||
-- @field Dcs.DCSWrapper.Controllable#Controllable DCSControllable The DCS controllable class.
|
||||
-- @field #string ControllableName The name of the controllable.
|
||||
CONTROLLABLE = {
|
||||
ClassName = "CONTROLLABLE",
|
||||
@ -138,7 +138,7 @@ CONTROLLABLE = {
|
||||
|
||||
--- Create a new CONTROLLABLE from a DCSControllable
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSControllable#Controllable ControllableName The DCS Controllable name
|
||||
-- @param Dcs.DCSWrapper.Controllable#Controllable ControllableName The DCS Controllable name
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:New( ControllableName )
|
||||
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) )
|
||||
@ -151,7 +151,7 @@ end
|
||||
|
||||
--- Get the controller for the CONTROLLABLE.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSController#Controller
|
||||
-- @return Dcs.DCSController#Controller
|
||||
function CONTROLLABLE:_GetController()
|
||||
self:F2( { self.ControllableName } )
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
@ -171,7 +171,7 @@ end
|
||||
|
||||
--- Popping current Task from the controllable.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return Controllable#CONTROLLABLE self
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||
function CONTROLLABLE:PopCurrentTask()
|
||||
self:F2()
|
||||
|
||||
@ -188,7 +188,7 @@ end
|
||||
|
||||
--- Pushing Task on the queue from the controllable.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return Controllable#CONTROLLABLE self
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||
function CONTROLLABLE:PushTask( DCSTask, WaitTime )
|
||||
self:F2()
|
||||
|
||||
@ -215,7 +215,7 @@ end
|
||||
|
||||
--- Clearing the Task Queue and Setting the Task on the queue from the controllable.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return Controllable#CONTROLLABLE self
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||
function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||
self:F2( { DCSTask } )
|
||||
|
||||
@ -245,13 +245,13 @@ end
|
||||
|
||||
--- Return a condition section for a controlled task.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTime#Time time
|
||||
-- @param Dcs.DCSTime#Time time
|
||||
-- @param #string userFlag
|
||||
-- @param #boolean userFlagValue
|
||||
-- @param #string condition
|
||||
-- @param DCSTime#Time duration
|
||||
-- @param Dcs.DCSTime#Time duration
|
||||
-- @param #number lastWayPoint
|
||||
-- return DCSTask#Task
|
||||
-- return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskCondition( time, userFlag, userFlagValue, condition, duration, lastWayPoint )
|
||||
self:F2( { time, userFlag, userFlagValue, condition, duration, lastWayPoint } )
|
||||
|
||||
@ -269,9 +269,9 @@ end
|
||||
|
||||
--- Return a Controlled Task taking a Task and a TaskCondition.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTask#Task DCSTask
|
||||
-- @param Dcs.DCSTasking.Task#Task DCSTask
|
||||
-- @param #DCSStopCondition DCSStopCondition
|
||||
-- @return DCSTask#Task
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskControlled( DCSTask, DCSStopCondition )
|
||||
self:F2( { DCSTask, DCSStopCondition } )
|
||||
|
||||
@ -291,8 +291,8 @@ end
|
||||
|
||||
--- Return a Combo Task taking an array of Tasks.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTask#TaskArray DCSTasks Array of @{DCSTask#Task}
|
||||
-- @return DCSTask#Task
|
||||
-- @param Dcs.DCSTasking.Task#TaskArray DCSTasks Array of @{Dcs.DCSTasking.Task#Task}
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskCombo( DCSTasks )
|
||||
self:F2( { DCSTasks } )
|
||||
|
||||
@ -311,8 +311,8 @@ end
|
||||
|
||||
--- Return a WrappedAction Task taking a Command.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSCommand#Command DCSCommand
|
||||
-- @return DCSTask#Task
|
||||
-- @param Dcs.DCSCommand#Command DCSCommand
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskWrappedAction( DCSCommand, Index )
|
||||
self:F2( { DCSCommand } )
|
||||
|
||||
@ -334,7 +334,7 @@ end
|
||||
|
||||
--- Executes a command action
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSCommand#Command DCSCommand
|
||||
-- @param Dcs.DCSCommand#Command DCSCommand
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:SetCommand( DCSCommand )
|
||||
self:F2( DCSCommand )
|
||||
@ -354,7 +354,7 @@ end
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number FromWayPoint
|
||||
-- @param #number ToWayPoint
|
||||
-- @return DCSTask#Task
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
-- @usage
|
||||
-- --- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
|
||||
-- HeliGroup = GROUP:FindByName( "Helicopter" )
|
||||
@ -385,7 +385,7 @@ end
|
||||
--- Perform stop route command
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean StopRoute
|
||||
-- @return DCSTask#Task
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:CommandStopRoute( StopRoute, Index )
|
||||
self:F2( { StopRoute, Index } )
|
||||
|
||||
@ -406,14 +406,14 @@ end
|
||||
|
||||
--- (AIR) Attack a Controllable.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE AttackGroup The Controllable to be attacked.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE AttackGroup The Controllable to be attacked.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param DCSTypes#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.
|
||||
-- @param #boolean AttackQtyLimit (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.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit )
|
||||
self:F2( { self.ControllableName, AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit } )
|
||||
|
||||
@ -464,14 +464,14 @@ end
|
||||
|
||||
--- (AIR) Attack the Unit.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Unit#UNIT AttackUnit The unit.
|
||||
-- @param Wrapper.Unit#UNIT AttackUnit The unit.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean AttackQtyLimit (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.
|
||||
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskAttackUnit( AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack )
|
||||
self:F2( { self.ControllableName, AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack } )
|
||||
|
||||
@ -508,13 +508,13 @@ end
|
||||
|
||||
--- (AIR) Delivering weapon at the point on the ground.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Vec2 2D-coordinates of the point to deliver weapon at.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point to deliver weapon at.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) Desired quantity of passes. The parameter is not the same in AttackControllable and AttackUnit tasks.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskBombing( Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||
self:F2( { self.ControllableName, Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack } )
|
||||
|
||||
@ -548,7 +548,7 @@ end
|
||||
|
||||
--- (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Point The point to hold the position.
|
||||
-- @param Dcs.DCSTypes#Vec2 Point The point to hold the position.
|
||||
-- @param #number Altitude The altitude to hold the position.
|
||||
-- @param #number Speed The speed flying when holding the position.
|
||||
-- @return #CONTROLLABLE self
|
||||
@ -626,13 +626,13 @@ end
|
||||
|
||||
--- (AIR) Attacking the map object (building, structure, e.t.c).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Vec2 2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskAttackMapObject( Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||
self:F2( { self.ControllableName, Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack } )
|
||||
|
||||
@ -667,13 +667,13 @@ end
|
||||
|
||||
--- (AIR) Delivering weapon on the runway.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Airbase#AIRBASE Airbase Airbase to attack.
|
||||
-- @param Wrapper.Airbase#AIRBASE Airbase Airbase to attack.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskBombingRunway( Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||
self:F2( { self.ControllableName, Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack } )
|
||||
|
||||
@ -708,7 +708,7 @@ end
|
||||
|
||||
--- (AIR) Refueling from the nearest tanker. No parameters.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskRefueling()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -730,7 +730,7 @@ end
|
||||
|
||||
--- (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Point The point where to land.
|
||||
-- @param Dcs.DCSTypes#Vec2 Point The point where to land.
|
||||
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:TaskLandAtVec2( Point, Duration )
|
||||
@ -767,9 +767,9 @@ function CONTROLLABLE:TaskLandAtVec2( Point, Duration )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- (AIR) Land the controllable at a @{Zone#ZONE_RADIUS).
|
||||
--- (AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Zone#ZONE Zone The zone where to land.
|
||||
-- @param Core.Zone#ZONE Zone The zone where to land.
|
||||
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:TaskLandAtZone( Zone, Duration, RandomPoint )
|
||||
@ -794,10 +794,10 @@ end
|
||||
-- The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders.
|
||||
-- If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE FollowControllable The controllable to be followed.
|
||||
-- @param DCSTypes#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE FollowControllable The controllable to be followed.
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param #number LastWaypointIndex Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskFollow( FollowControllable, Vec3, LastWaypointIndex )
|
||||
self:F2( { self.ControllableName, FollowControllable, Vec3, LastWaypointIndex } )
|
||||
|
||||
@ -836,12 +836,12 @@ end
|
||||
-- The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders.
|
||||
-- The unit / controllable will also protect that controllable from threats of specified types.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE EscortControllable The controllable to be escorted.
|
||||
-- @param DCSTypes#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE EscortControllable The controllable to be escorted.
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.
|
||||
-- @param #number LastWaypointIndex Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.
|
||||
-- @param #number EngagementDistanceMax Maximal distance from escorted controllable to threat. If the threat is already engaged by escort escort will disengage if the distance becomes greater than 1.5 * engagementDistMax.
|
||||
-- @param DCSTypes#AttributeNameArray TargetTypes Array of AttributeName that is contains threat categories allowed to engage.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @param Dcs.DCSTypes#AttributeNameArray TargetTypes Array of AttributeName that is contains threat categories allowed to engage.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes )
|
||||
self:F2( { self.ControllableName, FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes } )
|
||||
|
||||
@ -883,9 +883,9 @@ end
|
||||
|
||||
--- (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Vec2 The point to fire at.
|
||||
-- @param DCSTypes#Distance Radius The radius of the zone to deploy the fire at.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The point to fire at.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone to deploy the fire at.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius )
|
||||
self:F2( { self.ControllableName, Vec2, Radius } )
|
||||
|
||||
@ -911,7 +911,7 @@ end
|
||||
|
||||
--- (GROUND) Hold ground controllable from moving.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskHold()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -938,11 +938,11 @@ end
|
||||
-- The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.
|
||||
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE AttackGroup Target CONTROLLABLE.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE AttackGroup Target CONTROLLABLE.
|
||||
-- @param #number WeaponType Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.Designation Designation (optional) Designation type.
|
||||
-- @param Dcs.DCSTypes#AI.Task.Designation Designation (optional) Designation type.
|
||||
-- @param #boolean Datalink (optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation, Datalink )
|
||||
self:F2( { self.ControllableName, AttackGroup, WeaponType, Designation, Datalink } )
|
||||
|
||||
@ -974,10 +974,10 @@ end
|
||||
|
||||
--- (AIR) Engaging targets of defined types.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Distance Distance Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.
|
||||
-- @param DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
||||
-- @param Dcs.DCSTypes#Distance Distance Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.
|
||||
-- @param Dcs.DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
||||
-- @param #number Priority All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEngageTargets( Distance, TargetTypes, Priority )
|
||||
self:F2( { self.ControllableName, Distance, TargetTypes, Priority } )
|
||||
|
||||
@ -1007,11 +1007,11 @@ end
|
||||
|
||||
--- (AIR) Engaging a targets of defined types at circle-shaped zone.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Vec2 2D-coordinates of the zone.
|
||||
-- @param DCSTypes#Distance Radius Radius of the zone.
|
||||
-- @param DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the zone.
|
||||
-- @param Dcs.DCSTypes#Distance Radius Radius of the zone.
|
||||
-- @param Dcs.DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEngageTargets( Vec2, Radius, TargetTypes, Priority )
|
||||
self:F2( { self.ControllableName, Vec2, Radius, TargetTypes, Priority } )
|
||||
|
||||
@ -1042,15 +1042,15 @@ end
|
||||
|
||||
--- (AIR) Engaging a controllable. The task does not assign the target controllable to the unit/controllable to attack now; it just allows the unit/controllable to engage the target controllable as well as other assigned targets.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE AttackGroup The Controllable to be attacked.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE AttackGroup The Controllable to be attacked.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param DCSTypes#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.
|
||||
-- @param #boolean AttackQtyLimit (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.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit )
|
||||
self:F2( { self.ControllableName, AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit } )
|
||||
|
||||
@ -1103,15 +1103,15 @@ end
|
||||
|
||||
--- (AIR) Attack the Unit.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Unit#UNIT AttackUnit The UNIT.
|
||||
-- @param Wrapper.Unit#UNIT AttackUnit The UNIT.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
|
||||
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
|
||||
-- @param DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
|
||||
-- @param #boolean AttackQtyLimit (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.
|
||||
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEngageUnit( AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack )
|
||||
self:F2( { self.ControllableName, AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack } )
|
||||
|
||||
@ -1151,7 +1151,7 @@ end
|
||||
|
||||
--- (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskAWACS( )
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -1174,7 +1174,7 @@ end
|
||||
|
||||
--- (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskTanker( )
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -1199,7 +1199,7 @@ end
|
||||
|
||||
--- (GROUND) Ground unit (EW-radar) will act as an EWR for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskEWR( )
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -1226,12 +1226,12 @@ end
|
||||
-- The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.
|
||||
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Controllable#CONTROLLABLE AttackGroup Target CONTROLLABLE.
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE AttackGroup Target CONTROLLABLE.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @param #number WeaponType Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
|
||||
-- @param DCSTypes#AI.Task.Designation Designation (optional) Designation type.
|
||||
-- @param Dcs.DCSTypes#AI.Task.Designation Designation (optional) Designation type.
|
||||
-- @param #boolean Datalink (optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponType, Designation, Datalink )
|
||||
self:F2( { self.ControllableName, AttackGroup, WeaponType, Priority, Designation, Datalink } )
|
||||
|
||||
@ -1266,9 +1266,9 @@ end
|
||||
-- The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.
|
||||
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Distance Radius The maximal distance from the FAC to a target.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The maximal distance from the FAC to a target.
|
||||
-- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:EnRouteTaskFAC( Radius, Priority )
|
||||
self:F2( { self.ControllableName, Radius, Priority } )
|
||||
|
||||
@ -1297,10 +1297,10 @@ end
|
||||
|
||||
--- (AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param Dcs.DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param #number Duration The duration in seconds to wait.
|
||||
-- @param #CONTROLLABLE EmbarkingControllable The controllable to be embarked.
|
||||
-- @return DCSTask#Task The DCS task structure
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure
|
||||
function CONTROLLABLE:TaskEmbarking( Point, Duration, EmbarkingControllable )
|
||||
self:F2( { self.ControllableName, Point, Duration, EmbarkingControllable.DCSControllable } )
|
||||
|
||||
@ -1324,13 +1324,13 @@ end
|
||||
|
||||
--- Move to a defined Vec2 Point, and embark to a controllable when arrived within a defined Radius.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param Dcs.DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param #number Radius The radius of the embarking zone around the Point.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskEmbarkToTransport( Point, Radius )
|
||||
self:F2( { self.ControllableName, Point, Radius } )
|
||||
|
||||
local DCSTask --DCSTask#Task
|
||||
local DCSTask --Dcs.DCSTasking.Task#Task
|
||||
DCSTask = { id = 'EmbarkToTransport',
|
||||
params = { x = Point.x,
|
||||
y = Point.y,
|
||||
@ -1347,7 +1347,7 @@ end
|
||||
--- (AIR + GROUND) Return a mission task from a mission template.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #table TaskMission A table containing the mission task.
|
||||
-- @return DCSTask#Task
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskMission( TaskMission )
|
||||
self:F2( Points )
|
||||
|
||||
@ -1361,7 +1361,7 @@ end
|
||||
--- Return a Misson task to follow a given route defined by Points.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #table Points A table of route points.
|
||||
-- @return DCSTask#Task
|
||||
-- @return Dcs.DCSTasking.Task#Task
|
||||
function CONTROLLABLE:TaskRoute( Points )
|
||||
self:F2( Points )
|
||||
|
||||
@ -1374,7 +1374,7 @@ end
|
||||
|
||||
--- (AIR + GROUND) Make the Controllable move to fly to a given point.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param #number Speed The speed to travel.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:TaskRouteToVec2( Point, Speed )
|
||||
@ -1425,7 +1425,7 @@ end
|
||||
|
||||
--- (AIR + GROUND) Make the Controllable move to a given point.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param #number Speed The speed to travel.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:TaskRouteToVec3( Point, Speed )
|
||||
@ -1508,7 +1508,7 @@ end
|
||||
-- A speed can be given in km/h.
|
||||
-- A given formation can be given.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Zone#ZONE Zone The zone where to route to.
|
||||
-- @param Core.Zone#ZONE Zone The zone where to route to.
|
||||
-- @param #boolean Randomize Defines whether to target point gets randomized within the Zone.
|
||||
-- @param #number Speed The speed.
|
||||
-- @param Base#FORMATION Formation The formation string.
|
||||
@ -1566,11 +1566,11 @@ function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- (AIR) Return the Controllable to an @{Airbase#AIRBASE}
|
||||
--- (AIR) Return the Controllable to an @{Wrapper.Airbase#AIRBASE}
|
||||
-- A speed can be given in km/h.
|
||||
-- A given formation can be given.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Airbase#AIRBASE ReturnAirbase The @{Airbase#AIRBASE} to return to.
|
||||
-- @param Wrapper.Airbase#AIRBASE ReturnAirbase The @{Wrapper.Airbase#AIRBASE} to return to.
|
||||
-- @param #number Speed (optional) The speed.
|
||||
-- @return #string The route
|
||||
function CONTROLLABLE:RouteReturnToAirbase( ReturnAirbase, Speed )
|
||||
@ -1690,7 +1690,7 @@ function CONTROLLABLE:GetTaskRoute()
|
||||
return routines.utils.deepCopy( _DATABASE.Templates.Controllables[self.ControllableName].Template.route.points )
|
||||
end
|
||||
|
||||
--- Return the route of a controllable by using the @{Database#DATABASE} class.
|
||||
--- Return the route of a controllable by using the @{Core.Database#DATABASE} class.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Begin The route point from where the copy will start. The base route point is 0.
|
||||
-- @param #number End The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.
|
||||
@ -1745,7 +1745,7 @@ end
|
||||
--- Return the detected targets of the controllable.
|
||||
-- The optional parametes specify the detection methods that can be applied.
|
||||
-- If no detection method is given, the detection will use all the available methods by default.
|
||||
-- @param Controllable#CONTROLLABLE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE self
|
||||
-- @param #boolean DetectVisual (optional)
|
||||
-- @param #boolean DetectOptical (optional)
|
||||
-- @param #boolean DetectRadar (optional)
|
||||
@ -1814,8 +1814,8 @@ function CONTROLLABLE:OptionROEHoldFirePossible()
|
||||
end
|
||||
|
||||
--- Holding weapons.
|
||||
-- @param Controllable#CONTROLLABLE self
|
||||
-- @return Controllable#CONTROLLABLE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE self
|
||||
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||
function CONTROLLABLE:OptionROEHoldFire()
|
||||
self:F2( { self.ControllableName } )
|
||||
|
||||
@ -2115,7 +2115,7 @@ function CONTROLLABLE:OptionROTVertical()
|
||||
end
|
||||
|
||||
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
|
||||
-- Use the method @{Controllable#CONTROLLABLE:WayPointFunction} to define the hook functions for specific waypoints.
|
||||
-- Use the method @{Wrapper.Controllable#CONTROLLABLE:WayPointFunction} to define the hook functions for specific waypoints.
|
||||
-- Use the method @{Controllable@CONTROLLABLE:WayPointExecute) to start the execution of the new mission plan.
|
||||
-- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED!
|
||||
-- @param #CONTROLLABLE self
|
||||
@ -2206,8 +2206,8 @@ end
|
||||
--- Returns a message with the callsign embedded (if there is one).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @return Message#MESSAGE
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
-- @return Core.Message#MESSAGE
|
||||
function CONTROLLABLE:GetMessage( Message, Duration )
|
||||
|
||||
local DCSObject = self:GetDCSObject()
|
||||
@ -2222,7 +2222,7 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
function CONTROLLABLE:MessageToAll( Message, Duration )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -2238,7 +2238,7 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTYpes#Duration Duration The duration of the message.
|
||||
-- @param Dcs.DCSTYpes#Duration Duration The duration of the message.
|
||||
function CONTROLLABLE:MessageToRed( Message, Duration )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -2254,7 +2254,7 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
function CONTROLLABLE:MessageToBlue( Message, Duration )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -2270,8 +2270,8 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Client#CLIENT Client The client object receiving the message.
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Wrapper.Client#CLIENT Client The client object receiving the message.
|
||||
function CONTROLLABLE:MessageToClient( Message, Duration, Client )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -2287,8 +2287,8 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Group#GROUP MessageGroup The GROUP object receiving the message.
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message.
|
||||
function CONTROLLABLE:MessageToGroup( Message, Duration, MessageGroup )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -2306,7 +2306,7 @@ end
|
||||
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param DCSTypes#Duration Duration The duration of the message.
|
||||
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
|
||||
function CONTROLLABLE:Message( Message, Duration )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- This module contains the GROUP class.
|
||||
--
|
||||
-- 1) @{Group#GROUP} class, extends @{Controllable#CONTROLLABLE}
|
||||
-- 1) @{Wrapper.Group#GROUP} class, extends @{Wrapper.Controllable#CONTROLLABLE}
|
||||
-- =============================================================
|
||||
-- The @{Group#GROUP} class is a wrapper class to handle the DCS Group objects:
|
||||
-- The @{Wrapper.Group#GROUP} class is a wrapper class to handle the DCS Group objects:
|
||||
--
|
||||
-- * Support all DCS Group APIs.
|
||||
-- * Enhance with Group specific APIs not in the DCS Group API set.
|
||||
@ -32,7 +32,7 @@
|
||||
-- -----------------------
|
||||
-- Several group task methods are available that help you to prepare tasks.
|
||||
-- These methods return a string consisting of the task description, which can then be given to either a
|
||||
-- @{Controllable#CONTROLLABLE.PushTask} or @{Controllable#CONTROLLABLE.SetTask} method to assign the task to the GROUP.
|
||||
-- @{Wrapper.Controllable#CONTROLLABLE.PushTask} or @{Wrapper.Controllable#CONTROLLABLE.SetTask} method to assign the task to the GROUP.
|
||||
-- Tasks are specific for the category of the GROUP, more specific, for AIR, GROUND or AIR and GROUND.
|
||||
-- Each task description where applicable indicates for which group category the task is valid.
|
||||
-- There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.
|
||||
@ -44,63 +44,63 @@
|
||||
--
|
||||
-- Find below a list of the **assigned task** methods:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.TaskAttackGroup}: (AIR) Attack a Group.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
||||
-- * @{Controllable#CONTROLLABLE.TaskAttackUnit}: (AIR) Attack the Unit.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskBombing}: (Controllable#CONTROLLABLEDelivering weapon at the point on the ground.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskBombingRunway}: (AIR) Delivering weapon on the runway.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskEmbarking}: (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne group.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne group.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskHold}: (GROUND) Hold ground group from moving.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the group.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the group at a @{Zone#ZONE_RADIUS).
|
||||
-- * @{Controllable#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskRoute}: (AIR + GROUND) Return a Misson task to follow a given route defined by Points.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskRouteToVec2}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskRouteToVec3}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskRouteToZone}: (AIR + GROUND) Route the group to a given zone.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskReturnToBase}: (AIR) Route the group to an airbase.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackGroup}: (AIR) Attack a Group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackUnit}: (AIR) Attack the Unit.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskBombing}: (Wrapper.Controllable#CONTROLLABLEDelivering weapon at the point on the ground.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskBombingRunway}: (AIR) Delivering weapon on the runway.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEmbarking}: (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskHold}: (GROUND) Hold ground group from moving.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the group at a @{Core.Zone#ZONE_RADIUS).
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRoute}: (AIR + GROUND) Return a Misson task to follow a given route defined by Points.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToVec2}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToVec3}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToZone}: (AIR + GROUND) Route the group to a given zone.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskReturnToBase}: (AIR) Route the group to an airbase.
|
||||
--
|
||||
-- ### 1.2.2) EnRoute task methods
|
||||
--
|
||||
-- EnRoute tasks require the targets of the task need to be detected by the group (using its sensors) before the task can be executed:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskAWACS}: (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskEngageGroup}: (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskEWR}: (AIR) Attack the Unit.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskFAC}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose a targets (enemy ground group) around as well as other assigned targets.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskFAC_EngageGroup}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) as well as other assigned targets.
|
||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskTanker}: (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskAWACS}: (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEngageGroup}: (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEWR}: (AIR) Attack the Unit.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskFAC}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose a targets (enemy ground group) around as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskFAC_EngageGroup}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskTanker}: (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||
--
|
||||
-- ### 1.2.3) Preparation task methods
|
||||
--
|
||||
-- There are certain task methods that allow to tailor the task behaviour:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskCondition}: Return a condition section for a controlled task.
|
||||
-- * @{Controllable#CONTROLLABLE.TaskControlled}: Return a Controlled Task taking a Task and a TaskCondition.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskCondition}: Return a condition section for a controlled task.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskControlled}: Return a Controlled Task taking a Task and a TaskCondition.
|
||||
--
|
||||
-- ### 1.2.4) Obtain the mission from group templates
|
||||
--
|
||||
-- Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
--
|
||||
-- 1.3) GROUP Command methods
|
||||
-- --------------------------
|
||||
-- Group **command methods** prepare the execution of commands using the @{Controllable#CONTROLLABLE.SetCommand} method:
|
||||
-- Group **command methods** prepare the execution of commands using the @{Wrapper.Controllable#CONTROLLABLE.SetCommand} method:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.CommandDoScript}: Do Script command.
|
||||
-- * @{Controllable#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandDoScript}: Do Script command.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
||||
--
|
||||
-- 1.4) GROUP Option methods
|
||||
-- -------------------------
|
||||
@ -108,31 +108,31 @@
|
||||
--
|
||||
-- ### 1.4.1) Rule of Engagement:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEWeaponFree}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEOpenFire}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEReturnFire}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEEvadeFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFree}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFire}
|
||||
--
|
||||
-- To check whether an ROE option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEWeaponFreePossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEOpenFirePossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEReturnFirePossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROEEvadeFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFreePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFirePossible}
|
||||
--
|
||||
-- ### 1.4.2) Rule on thread:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTNoReaction}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTPassiveDefense}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTEvadeFire}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTVertical}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReaction}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefense}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVertical}
|
||||
--
|
||||
-- To test whether an ROT option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTNoReactionPossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTPassiveDefensePossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTEvadeFirePossible}
|
||||
-- * @{Controllable#CONTROLLABLE.OptionROTVerticalPossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReactionPossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefensePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVerticalPossible}
|
||||
--
|
||||
-- 1.5) GROUP Zone validation methods
|
||||
-- ----------------------------------
|
||||
@ -143,14 +143,14 @@
|
||||
-- * @{#GROUP.IsPartlyInZone}: Returns true if some units of the group are within a @{Zone}.
|
||||
-- * @{#GROUP.IsNotInZone}: Returns true if none of the group units of the group are within a @{Zone}.
|
||||
--
|
||||
-- The zone can be of any @{Zone} class derived from @{Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
|
||||
-- The zone can be of any @{Zone} class derived from @{Core.Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
|
||||
--
|
||||
-- @module Group
|
||||
-- @author FlightControl
|
||||
|
||||
--- The GROUP class
|
||||
-- @type GROUP
|
||||
-- @extends Controllable#CONTROLLABLE
|
||||
-- @extends Wrapper.Controllable#CONTROLLABLE
|
||||
-- @field #string GroupName The name of the group.
|
||||
GROUP = {
|
||||
ClassName = "GROUP",
|
||||
@ -158,7 +158,7 @@ GROUP = {
|
||||
|
||||
--- Create a new GROUP from a DCSGroup
|
||||
-- @param #GROUP self
|
||||
-- @param DCSGroup#Group GroupName The DCS Group name
|
||||
-- @param Dcs.DCSWrapper.Group#Group GroupName The DCS Group name
|
||||
-- @return #GROUP self
|
||||
function GROUP:Register( GroupName )
|
||||
local self = BASE:Inherit( self, CONTROLLABLE:New( GroupName ) )
|
||||
@ -171,11 +171,11 @@ end
|
||||
|
||||
--- Find the GROUP wrapper class instance using the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSGroup#Group DCSGroup The DCS Group.
|
||||
-- @param Dcs.DCSWrapper.Group#Group DCSGroup The DCS Group.
|
||||
-- @return #GROUP The GROUP.
|
||||
function GROUP:Find( DCSGroup )
|
||||
|
||||
local GroupName = DCSGroup:getName() -- Group#GROUP
|
||||
local GroupName = DCSGroup:getName() -- Wrapper.Group#GROUP
|
||||
local GroupFound = _DATABASE:FindGroup( GroupName )
|
||||
return GroupFound
|
||||
end
|
||||
@ -194,7 +194,7 @@ end
|
||||
|
||||
--- Returns the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return DCSGroup#Group The DCS Group.
|
||||
-- @return Dcs.DCSWrapper.Group#Group The DCS Group.
|
||||
function GROUP:GetDCSObject()
|
||||
local DCSGroup = Group.getByName( self.GroupName )
|
||||
|
||||
@ -246,7 +246,7 @@ end
|
||||
|
||||
--- Returns category of the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return DCSGroup#Group.Category The category ID
|
||||
-- @return Dcs.DCSWrapper.Group#Group.Category The category ID
|
||||
function GROUP:GetCategory()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
@ -286,7 +286,7 @@ end
|
||||
|
||||
--- Returns the coalition of the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return DCSCoalitionObject#coalition.side The coalition side of the DCS Group.
|
||||
-- @return Dcs.DCSCoalitionWrapper.Object#coalition.side The coalition side of the DCS Group.
|
||||
function GROUP:GetCoalition()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
@ -302,7 +302,7 @@ end
|
||||
|
||||
--- Returns the country of the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return DCScountry#country.id The country identifier.
|
||||
-- @return Dcs.DCScountry#country.id The country identifier.
|
||||
-- @return #nil The DCS Group is not existing or alive.
|
||||
function GROUP:GetCountry()
|
||||
self:F2( self.GroupName )
|
||||
@ -321,7 +321,7 @@ end
|
||||
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
||||
-- @param #GROUP self
|
||||
-- @param #number UnitNumber The number of the UNIT wrapper class to be returned.
|
||||
-- @return Unit#UNIT The UNIT wrapper class.
|
||||
-- @return Wrapper.Unit#UNIT The UNIT wrapper class.
|
||||
function GROUP:GetUnit( UnitNumber )
|
||||
self:F2( { self.GroupName, UnitNumber } )
|
||||
|
||||
@ -341,7 +341,7 @@ end
|
||||
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
||||
-- @param #GROUP self
|
||||
-- @param #number UnitNumber The number of the DCS Unit to be returned.
|
||||
-- @return DCSUnit#Unit The DCS Unit.
|
||||
-- @return Dcs.DCSWrapper.Unit#Unit The DCS Unit.
|
||||
function GROUP:GetDCSUnit( UnitNumber )
|
||||
self:F2( { self.GroupName, UnitNumber } )
|
||||
|
||||
@ -474,7 +474,7 @@ end
|
||||
|
||||
--- Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return DCSTypes#Vec2 Current Vec2 point of the first DCS Unit of the DCS Group.
|
||||
-- @return Dcs.DCSTypes#Vec2 Current Vec2 point of the first DCS Unit of the DCS Group.
|
||||
function GROUP:GetVec2()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
@ -486,7 +486,7 @@ function GROUP:GetVec2()
|
||||
end
|
||||
|
||||
--- Returns the current Vec3 vector of the first DCS Unit in the GROUP.
|
||||
-- @return DCSTypes#Vec3 Current Vec3 of the first DCS Unit of the GROUP.
|
||||
-- @return Dcs.DCSTypes#Vec3 Current Vec3 of the first DCS Unit of the GROUP.
|
||||
function GROUP:GetVec3()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
@ -501,13 +501,13 @@ end
|
||||
|
||||
--- Returns true if all units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||
function GROUP:IsCompletelyInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Unit#UNIT
|
||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||
-- TODO: Rename IsPointVec3InZone to IsVec3InZone
|
||||
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||
else
|
||||
@ -520,13 +520,13 @@ end
|
||||
|
||||
--- Returns true if some units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||
function GROUP:IsPartlyInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Unit#UNIT
|
||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||
return true
|
||||
end
|
||||
@ -537,13 +537,13 @@ end
|
||||
|
||||
--- Returns true if none of the group units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||
function GROUP:IsNotInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Unit#UNIT
|
||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||
return false
|
||||
end
|
||||
@ -712,7 +712,7 @@ end
|
||||
-- SPAWNING
|
||||
|
||||
--- Respawn the @{GROUP} using a (tweaked) template of the Group.
|
||||
-- The template must be retrieved with the @{Group#GROUP.GetTemplate}() function.
|
||||
-- The template must be retrieved with the @{Wrapper.Group#GROUP.GetTemplate}() function.
|
||||
-- The template contains all the definitions as declared within the mission file.
|
||||
-- To understand templates, do the following:
|
||||
--
|
||||
@ -728,7 +728,7 @@ end
|
||||
-- * When the group is alive, it will tweak the template x, y and heading coordinates of the group and the embedded units to the current units positions.
|
||||
-- * Then it will destroy the current alive group.
|
||||
-- * And it will respawn the group using your new template definition.
|
||||
-- @param Group#GROUP self
|
||||
-- @param Wrapper.Group#GROUP self
|
||||
-- @param #table Template The template of the Group retrieved with GROUP:GetTemplate()
|
||||
function GROUP:Respawn( Template )
|
||||
|
||||
@ -740,7 +740,7 @@ function GROUP:Respawn( Template )
|
||||
|
||||
self:E( #Template.units )
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local GroupUnit = UnitData -- Unit#UNIT
|
||||
local GroupUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
self:E( GroupUnit:GetName() )
|
||||
if GroupUnit:IsAlive() then
|
||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||
@ -777,7 +777,7 @@ end
|
||||
|
||||
--- Sets the CountryID of the group in a Template.
|
||||
-- @param #GROUP self
|
||||
-- @param DCScountry#country.id CountryID The country ID.
|
||||
-- @param Dcs.DCScountry#country.id CountryID The country ID.
|
||||
-- @return #table
|
||||
function GROUP:SetTemplateCountry( Template, CountryID )
|
||||
Template.CountryID = CountryID
|
||||
@ -786,7 +786,7 @@ end
|
||||
|
||||
--- Sets the CoalitionID of the group in a Template.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSCoalitionObject#coalition.side CoalitionID The coalition ID.
|
||||
-- @param Dcs.DCSCoalitionWrapper.Object#coalition.side CoalitionID The coalition ID.
|
||||
-- @return #table
|
||||
function GROUP:SetTemplateCoalition( Template, CoalitionID )
|
||||
Template.CoalitionID = CoalitionID
|
||||
@ -814,7 +814,7 @@ function GROUP:GetTaskRoute()
|
||||
return routines.utils.deepCopy( _DATABASE.Templates.Groups[self.GroupName].Template.route.points )
|
||||
end
|
||||
|
||||
--- Return the route of a group by using the @{Database#DATABASE} class.
|
||||
--- Return the route of a group by using the @{Core.Database#DATABASE} class.
|
||||
-- @param #GROUP self
|
||||
-- @param #number Begin The route point from where the copy will start. The base route point is 0.
|
||||
-- @param #number End The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- This module contains the IDENTIFIABLE class.
|
||||
--
|
||||
-- 1) @{#IDENTIFIABLE} class, extends @{Object#OBJECT}
|
||||
-- 1) @{#IDENTIFIABLE} class, extends @{Wrapper.Object#OBJECT}
|
||||
-- ===============================================================
|
||||
-- The @{#IDENTIFIABLE} class is a wrapper class to handle the DCS Identifiable objects:
|
||||
--
|
||||
@ -50,7 +50,7 @@ local _CategoryName = {
|
||||
|
||||
--- Create a new IDENTIFIABLE from a DCSIdentifiable
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @param DCSIdentifiable#Identifiable IdentifiableName The DCS Identifiable name
|
||||
-- @param Dcs.DCSWrapper.Identifiable#Identifiable IdentifiableName The DCS Identifiable name
|
||||
-- @return #IDENTIFIABLE self
|
||||
function IDENTIFIABLE:New( IdentifiableName )
|
||||
local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) )
|
||||
@ -121,7 +121,7 @@ end
|
||||
|
||||
--- Returns category of the DCS Identifiable.
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @return DCSObject#Object.Category The category ID
|
||||
-- @return Dcs.DCSWrapper.Object#Object.Category The category ID
|
||||
function IDENTIFIABLE:GetCategory()
|
||||
self:F2( self.ObjectName )
|
||||
|
||||
@ -153,7 +153,7 @@ end
|
||||
|
||||
--- Returns coalition of the Identifiable.
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @return DCSCoalitionObject#coalition.side The side of the coalition.
|
||||
-- @return Dcs.DCSCoalitionWrapper.Object#coalition.side The side of the coalition.
|
||||
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||
function IDENTIFIABLE:GetCoalition()
|
||||
self:F2( self.IdentifiableName )
|
||||
@ -172,7 +172,7 @@ end
|
||||
|
||||
--- Returns country of the Identifiable.
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @return DCScountry#country.id The country identifier.
|
||||
-- @return Dcs.DCScountry#country.id The country identifier.
|
||||
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||
function IDENTIFIABLE:GetCountry()
|
||||
self:F2( self.IdentifiableName )
|
||||
@ -193,7 +193,7 @@ end
|
||||
|
||||
--- Returns Identifiable descriptor. Descriptor type depends on Identifiable category.
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @return DCSIdentifiable#Identifiable.Desc The Identifiable descriptor.
|
||||
-- @return Dcs.DCSWrapper.Identifiable#Identifiable.Desc The Identifiable descriptor.
|
||||
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||
function IDENTIFIABLE:GetDesc()
|
||||
self:F2( self.IdentifiableName )
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- This module contains the OBJECT class.
|
||||
--
|
||||
-- 1) @{Object#OBJECT} class, extends @{Base#BASE}
|
||||
-- 1) @{Wrapper.Object#OBJECT} class, extends @{Core.Base#BASE}
|
||||
-- ===========================================================
|
||||
-- The @{Object#OBJECT} class is a wrapper class to handle the DCS Object objects:
|
||||
-- The @{Wrapper.Object#OBJECT} class is a wrapper class to handle the DCS Object objects:
|
||||
--
|
||||
-- * Support all DCS Object APIs.
|
||||
-- * Enhance with Object specific APIs not in the DCS Object API set.
|
||||
@ -12,13 +12,13 @@
|
||||
-- ------------------------------
|
||||
-- The OBJECT class provides the following functions to construct a OBJECT instance:
|
||||
--
|
||||
-- * @{Object#OBJECT.New}(): Create a OBJECT instance.
|
||||
-- * @{Wrapper.Object#OBJECT.New}(): Create a OBJECT instance.
|
||||
--
|
||||
-- 1.2) OBJECT methods:
|
||||
-- --------------------------
|
||||
-- The following methods can be used to identify an Object object:
|
||||
--
|
||||
-- * @{Object#OBJECT.GetID}(): Returns the ID of the Object object.
|
||||
-- * @{Wrapper.Object#OBJECT.GetID}(): Returns the ID of the Object object.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -41,7 +41,7 @@ OBJECT = {
|
||||
|
||||
--- Create a new OBJECT from a DCSObject
|
||||
-- @param #OBJECT self
|
||||
-- @param DCSObject#Object ObjectName The Object name
|
||||
-- @param Dcs.DCSWrapper.Object#Object ObjectName The Object name
|
||||
-- @return #OBJECT self
|
||||
function OBJECT:New( ObjectName )
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
@ -52,8 +52,8 @@ end
|
||||
|
||||
|
||||
--- Returns the unit's unique identifier.
|
||||
-- @param Object#OBJECT self
|
||||
-- @return DCSObject#Object.ID ObjectID
|
||||
-- @param Wrapper.Object#OBJECT self
|
||||
-- @return Dcs.DCSWrapper.Object#Object.ID ObjectID
|
||||
-- @return #nil The DCS Object is not existing or alive.
|
||||
function OBJECT:GetID()
|
||||
self:F2( self.ObjectName )
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- This module contains the POSITIONABLE class.
|
||||
--
|
||||
-- 1) @{Positionable#POSITIONABLE} class, extends @{Identifiable#IDENTIFIABLE}
|
||||
-- 1) @{Wrapper.Positionable#POSITIONABLE} class, extends @{Wrapper.Identifiable#IDENTIFIABLE}
|
||||
-- ===========================================================
|
||||
-- The @{Positionable#POSITIONABLE} class is a wrapper class to handle the POSITIONABLE objects:
|
||||
-- The @{Wrapper.Positionable#POSITIONABLE} class is a wrapper class to handle the POSITIONABLE objects:
|
||||
--
|
||||
-- * Support all DCS APIs.
|
||||
-- * Enhance with POSITIONABLE specific APIs not in the DCS API set.
|
||||
@ -12,14 +12,14 @@
|
||||
-- ------------------------------
|
||||
-- The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:
|
||||
--
|
||||
-- * @{Positionable#POSITIONABLE.New}(): Create a POSITIONABLE instance.
|
||||
-- * @{Wrapper.Positionable#POSITIONABLE.New}(): Create a POSITIONABLE instance.
|
||||
--
|
||||
-- 1.2) POSITIONABLE methods:
|
||||
-- --------------------------
|
||||
-- The following methods can be used to identify an measurable object:
|
||||
--
|
||||
-- * @{Positionable#POSITIONABLE.GetID}(): Returns the ID of the measurable object.
|
||||
-- * @{Positionable#POSITIONABLE.GetName}(): Returns the name of the measurable object.
|
||||
-- * @{Wrapper.Positionable#POSITIONABLE.GetID}(): Returns the ID of the measurable object.
|
||||
-- * @{Wrapper.Positionable#POSITIONABLE.GetName}(): Returns the name of the measurable object.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -41,7 +41,7 @@ POSITIONABLE = {
|
||||
|
||||
--- Create a new POSITIONABLE from a DCSPositionable
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param DCSPositionable#Positionable PositionableName The POSITIONABLE name
|
||||
-- @param Dcs.DCSWrapper.Positionable#Positionable PositionableName The POSITIONABLE name
|
||||
-- @return #POSITIONABLE self
|
||||
function POSITIONABLE:New( PositionableName )
|
||||
local self = BASE:Inherit( self, IDENTIFIABLE:New( PositionableName ) )
|
||||
@ -49,9 +49,9 @@ function POSITIONABLE:New( PositionableName )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
||||
--- Returns the @{Dcs.DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPositionVec3()
|
||||
self:F2( self.PositionableName )
|
||||
@ -67,9 +67,9 @@ function POSITIONABLE:GetPositionVec3()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the POSITIONABLE within the mission.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Vec2 The 2D point vector of the POSITIONABLE.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec2} vector indicating the point in 2D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Vec2 The 2D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetVec2()
|
||||
self:F2( self.PositionableName )
|
||||
@ -91,8 +91,8 @@ function POSITIONABLE:GetVec2()
|
||||
end
|
||||
|
||||
--- Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Core.Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPointVec2()
|
||||
self:F2( self.PositionableName )
|
||||
@ -112,9 +112,9 @@ function POSITIONABLE:GetPointVec2()
|
||||
end
|
||||
|
||||
|
||||
--- Returns a random @{DCSTypes#Vec3} vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||
--- Returns a random @{Dcs.DCSTypes#Vec3} vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetRandomVec3( Radius )
|
||||
self:F2( self.PositionableName )
|
||||
@ -136,9 +136,9 @@ function POSITIONABLE:GetRandomVec3( Radius )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the @{DCSTypes#Vec3} vector indicating the 3D vector of the POSITIONABLE within the mission.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||
--- Returns the @{Dcs.DCSTypes#Vec3} vector indicating the 3D vector of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetVec3()
|
||||
self:F2( self.PositionableName )
|
||||
@ -155,8 +155,8 @@ function POSITIONABLE:GetVec3()
|
||||
end
|
||||
|
||||
--- Returns the altitude of the POSITIONABLE.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Distance The altitude of the POSITIONABLE.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Distance The altitude of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetAltitude()
|
||||
self:F2()
|
||||
@ -164,7 +164,7 @@ function POSITIONABLE:GetAltitude()
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
local PositionablePointVec3 = DCSPositionable:getPoint() --DCSTypes#Vec3
|
||||
local PositionablePointVec3 = DCSPositionable:getPoint() --Dcs.DCSTypes#Vec3
|
||||
return PositionablePointVec3.y
|
||||
end
|
||||
|
||||
@ -172,7 +172,7 @@ function POSITIONABLE:GetAltitude()
|
||||
end
|
||||
|
||||
--- Returns if the Positionable is located above a runway.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return #boolean true if Positionable is above a runway.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:IsAboveRunway()
|
||||
@ -196,7 +196,7 @@ end
|
||||
|
||||
|
||||
--- Returns the POSITIONABLE heading in degrees.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return #number The POSTIONABLE heading
|
||||
function POSITIONABLE:GetHeading()
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
@ -220,7 +220,7 @@ end
|
||||
|
||||
|
||||
--- Returns true if the POSITIONABLE is in the air.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return #boolean true if in the air.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:InAir()
|
||||
@ -239,8 +239,8 @@ end
|
||||
|
||||
|
||||
--- Returns the POSITIONABLE velocity vector.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @return DCSTypes#Vec3 The velocity vector
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Vec3 The velocity vector
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetVelocity()
|
||||
self:F2( self.PositionableName )
|
||||
@ -257,7 +257,7 @@ function POSITIONABLE:GetVelocity()
|
||||
end
|
||||
|
||||
--- Returns the POSITIONABLE velocity in km/h.
|
||||
-- @param Positionable#POSITIONABLE self
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return #number The velocity in km/h
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetVelocityKMH()
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
--- This module contains the STATIC class.
|
||||
--
|
||||
-- 1) @{Static#STATIC} class, extends @{Positionable#POSITIONABLE}
|
||||
-- 1) @{Wrapper.Static#STATIC} class, extends @{Wrapper.Positionable#POSITIONABLE}
|
||||
-- ===============================================================
|
||||
-- Statics are **Static Units** defined within the Mission Editor.
|
||||
-- Note that Statics are almost the same as Units, but they don't have a controller.
|
||||
-- The @{Static#STATIC} class is a wrapper class to handle the DCS Static objects:
|
||||
-- The @{Wrapper.Static#STATIC} class is a wrapper class to handle the DCS Static objects:
|
||||
--
|
||||
-- * Wraps the DCS Static objects.
|
||||
-- * Support all DCS Static APIs.
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
--- The STATIC class
|
||||
-- @type STATIC
|
||||
-- @extends Positionable#POSITIONABLE
|
||||
-- @extends Wrapper.Positionable#POSITIONABLE
|
||||
STATIC = {
|
||||
ClassName = "STATIC",
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- This module contains the UNIT class.
|
||||
--
|
||||
-- 1) @{#UNIT} class, extends @{Controllable#CONTROLLABLE}
|
||||
-- 1) @{#UNIT} class, extends @{Wrapper.Controllable#CONTROLLABLE}
|
||||
-- ===========================================================
|
||||
-- The @{#UNIT} class is a wrapper class to handle the DCS Unit objects:
|
||||
--
|
||||
@ -33,7 +33,7 @@
|
||||
-- ------------------
|
||||
-- The DCS Unit APIs are used extensively within MOOSE. The UNIT class has for each DCS Unit API a corresponding method.
|
||||
-- To be able to distinguish easily in your code the difference between a UNIT API call and a DCS Unit API call,
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Unit method @{DCSUnit#Unit.getName}()
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Unit method @{Dcs.DCSWrapper.Unit#Unit.getName}()
|
||||
-- is implemented in the UNIT class as @{#UNIT.GetName}().
|
||||
--
|
||||
-- 1.3) Smoke, Flare Units
|
||||
@ -60,7 +60,7 @@
|
||||
-- The UNIT class contains methods to test the location or proximity against zones or other objects.
|
||||
--
|
||||
-- ### 1.6.1) Zones
|
||||
-- To test whether the Unit is within a **zone**, use the @{#UNIT.IsInZone}() or the @{#UNIT.IsNotInZone}() methods. Any zone can be tested on, but the zone must be derived from @{Zone#ZONE_BASE}.
|
||||
-- To test whether the Unit is within a **zone**, use the @{#UNIT.IsInZone}() or the @{#UNIT.IsNotInZone}() methods. Any zone can be tested on, but the zone must be derived from @{Core.Zone#ZONE_BASE}.
|
||||
--
|
||||
-- ### 1.6.2) Units
|
||||
-- Test if another DCS Unit is within a given radius of the current DCS Unit, use the @{#UNIT.OtherUnitInRadius}() method.
|
||||
@ -133,7 +133,7 @@ end
|
||||
|
||||
--- Finds a UNIT from the _DATABASE using a DCSUnit object.
|
||||
-- @param #UNIT self
|
||||
-- @param DCSUnit#Unit DCSUnit An existing DCS Unit object reference.
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit DCSUnit An existing DCS Unit object reference.
|
||||
-- @return #UNIT self
|
||||
function UNIT:Find( DCSUnit )
|
||||
|
||||
@ -162,7 +162,7 @@ end
|
||||
|
||||
|
||||
--- @param #UNIT self
|
||||
-- @return DCSUnit#Unit
|
||||
-- @return Dcs.DCSWrapper.Unit#Unit
|
||||
function UNIT:GetDCSObject()
|
||||
|
||||
local DCSUnit = Unit.getByName( self.UnitName )
|
||||
@ -183,7 +183,7 @@ end
|
||||
-- * Then it will respawn the re-modelled group.
|
||||
--
|
||||
-- @param #UNIT self
|
||||
-- @param DCSTypes#Vec3 SpawnVec3 The position where to Spawn the new Unit at.
|
||||
-- @param Dcs.DCSTypes#Vec3 SpawnVec3 The position where to Spawn the new Unit at.
|
||||
-- @param #number Heading The heading of the unit respawn.
|
||||
function UNIT:ReSpawn( SpawnVec3, Heading )
|
||||
|
||||
@ -383,7 +383,7 @@ end
|
||||
|
||||
--- Returns the Unit's ammunition.
|
||||
-- @param #UNIT self
|
||||
-- @return DCSUnit#Unit.Ammo
|
||||
-- @return Dcs.DCSWrapper.Unit#Unit.Ammo
|
||||
-- @return #nil The DCS Unit is not existing or alive.
|
||||
function UNIT:GetAmmo()
|
||||
self:F2( self.UnitName )
|
||||
@ -400,7 +400,7 @@ end
|
||||
|
||||
--- Returns the unit sensors.
|
||||
-- @param #UNIT self
|
||||
-- @return DCSUnit#Unit.Sensors
|
||||
-- @return Dcs.DCSWrapper.Unit#Unit.Sensors
|
||||
-- @return #nil The DCS Unit is not existing or alive.
|
||||
function UNIT:GetSensors()
|
||||
self:F2( self.UnitName )
|
||||
@ -464,7 +464,7 @@ end
|
||||
-- * Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.
|
||||
-- @param #UNIT self
|
||||
-- @return #boolean Indicates if at least one of the unit's radar(s) is on.
|
||||
-- @return DCSObject#Object The object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.
|
||||
-- @return Dcs.DCSWrapper.Object#Object The object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.
|
||||
-- @return #nil The DCS Unit is not existing or alive.
|
||||
function UNIT:GetRadar()
|
||||
self:F2( self.UnitName )
|
||||
@ -591,8 +591,8 @@ end
|
||||
|
||||
--- Returns true if the unit is within a @{Zone}.
|
||||
-- @param #UNIT self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is within the @{Zone#ZONE_BASE}
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is within the @{Core.Zone#ZONE_BASE}
|
||||
function UNIT:IsInZone( Zone )
|
||||
self:F2( { self.UnitName, Zone } )
|
||||
|
||||
@ -608,8 +608,8 @@ end
|
||||
|
||||
--- Returns true if the unit is not within a @{Zone}.
|
||||
-- @param #UNIT self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is not within the @{Zone#ZONE_BASE}
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is not within the @{Core.Zone#ZONE_BASE}
|
||||
function UNIT:IsNotInZone( Zone )
|
||||
self:F2( { self.UnitName, Zone } )
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ end
|
||||
|
||||
--- Handle the S_EVENT_DEAD events to validate the destruction of units for the task monitoring.
|
||||
-- @param #DESTROYBASETASK self
|
||||
-- @param Event#EVENTDATA Event structure of MOOSE.
|
||||
-- @param Core.Event#EVENTDATA Event structure of MOOSE.
|
||||
function DESTROYBASETASK:EventDead( Event )
|
||||
self:F( { Event } )
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@ end
|
||||
|
||||
--- Report Goal Progress.
|
||||
-- @param #DESTROYGROUPSTASK self
|
||||
-- @param DCSGroup#Group DestroyGroup Group structure describing the group to be evaluated.
|
||||
-- @param DCSUnit#Unit DestroyUnit Unit structure describing the Unit to be evaluated.
|
||||
-- @param Dcs.DCSWrapper.Group#Group DestroyGroup Group structure describing the group to be evaluated.
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit DestroyUnit Unit structure describing the Unit to be evaluated.
|
||||
-- @return #number The DestroyCount reflecting the amount of units destroyed within the group.
|
||||
function DESTROYGROUPSTASK:ReportGoalProgress( DestroyGroup, DestroyUnit )
|
||||
self:F( { DestroyGroup, DestroyUnit, self.DestroyPercentage } )
|
||||
|
||||
@ -68,9 +68,9 @@ end
|
||||
|
||||
--- Execute
|
||||
-- @param #STAGEBRIEF self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
-- @return #boolean
|
||||
function STAGEBRIEF:Execute( Mission, Client, Task )
|
||||
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
||||
@ -228,9 +228,9 @@ end
|
||||
|
||||
--- Execute the routing.
|
||||
-- @param #STAGEROUTE self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
function STAGEROUTE:Execute( Mission, Client, Task )
|
||||
self:F()
|
||||
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
||||
@ -300,9 +300,9 @@ end
|
||||
|
||||
--- Execute the landing coordination.
|
||||
-- @param #STAGELANDING self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
function STAGELANDING:Execute( Mission, Client, Task )
|
||||
self:F()
|
||||
|
||||
@ -524,9 +524,9 @@ end
|
||||
|
||||
--- Coordinate UnLoading
|
||||
-- @param #STAGEUNLOAD self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
function STAGEUNLOAD:Execute( Mission, Client, Task )
|
||||
self:F()
|
||||
|
||||
@ -562,9 +562,9 @@ end
|
||||
|
||||
--- Validate UnLoading
|
||||
-- @param #STAGEUNLOAD self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
function STAGEUNLOAD:Validate( Mission, Client, Task )
|
||||
self:F()
|
||||
env.info( 'STAGEUNLOAD:Validate()' )
|
||||
@ -835,9 +835,9 @@ end
|
||||
|
||||
--- Execute Arrival
|
||||
-- @param #STAGEARRIVE self
|
||||
-- @param Mission#MISSION Mission
|
||||
-- @param Client#CLIENT Client
|
||||
-- @param Task#TASK Task
|
||||
-- @param Tasking.Mission#MISSION Mission
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param Tasking.Task#TASK Task
|
||||
function STAGEARRIVE:Execute( Mission, Client, Task )
|
||||
self:F()
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ do
|
||||
MenuStatus[MenuClientName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Client#CLIENT MenuClient
|
||||
--- @param Wrapper.Client#CLIENT MenuClient
|
||||
local function AddStatusMenu( MenuClient )
|
||||
local MenuClientName = MenuClient:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
|
||||
@ -21,7 +21,7 @@ do
|
||||
MenuStatus[MenuGroupName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Group#GROUP MenuGroup
|
||||
--- @param Wrapper.Group#GROUP MenuGroup
|
||||
local function AddStatusMenu( MenuGroup )
|
||||
local MenuGroupName = MenuGroup:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
|
||||
@ -33,15 +33,15 @@ Patrol2:ManageFuel( 0.2, 0 )
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param #PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||
function Patrol1:OnBeforeRTB( AIGroup )
|
||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol1:OnAfterRTB( AIGroup )
|
||||
local NewGroup = PatrolSpawn:Spawn()
|
||||
Patrol2:SetControllable( NewGroup )
|
||||
@ -49,23 +49,23 @@ function Patrol1:OnAfterRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol1:OnAfterPatrol( AIGroup )
|
||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param #PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||
function Patrol2:OnBeforeRTB( AIGroup )
|
||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol2:OnAfterRTB( AIGroup )
|
||||
local NewGroup = PatrolSpawn:Spawn()
|
||||
Patrol1:SetControllable( NewGroup )
|
||||
@ -73,8 +73,8 @@ function Patrol2:OnAfterRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
||||
-- @param Group#GROUP AIGroup
|
||||
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol2:OnAfterPatrol( AIGroup )
|
||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
||||
end
|
||||
|
||||
@ -7,10 +7,10 @@ SetVehicles = SET_GROUP:New()
|
||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||
|
||||
SetVehicles:ForEachGroup(
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeGreen()
|
||||
end
|
||||
end
|
||||
@ -88,30 +88,30 @@ end
|
||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||
|
||||
SetBluePlanesGroup:ForEachGroup(
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetNorthKoreaGroup:ForEachGroup(
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeRed()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetSAMGroup:ForEachGroup(
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeOrange()
|
||||
end
|
||||
end
|
||||
@ -126,30 +126,30 @@ ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( POINT
|
||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( POINT_VEC3.SmokeColor.White )
|
||||
|
||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||
--- @param Group#GROUP MooseGroup
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Unit#UNIT
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user