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
|
-- 1.1) BASE constructor
|
||||||
-- ---------------------
|
-- ---------------------
|
||||||
-- Any class derived from BASE, must use the @{Base#BASE.New) constructor within the @{Base#BASE.Inherit) method.
|
-- 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 @{Base#BASE.New} method how this is done.
|
-- See an example at the @{Core.Base#BASE.New} method how this is done.
|
||||||
--
|
--
|
||||||
-- 1.2) BASE Trace functionality
|
-- 1.2) BASE Trace functionality
|
||||||
-- -----------------------------
|
-- -----------------------------
|
||||||
@ -199,7 +199,7 @@ end
|
|||||||
|
|
||||||
--- Set a new listener for the class.
|
--- Set a new listener for the class.
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param DCSTypes#Event Event
|
-- @param Dcs.DCSTypes#Event Event
|
||||||
-- @param #function EventFunction
|
-- @param #function EventFunction
|
||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
function BASE:AddEvent( Event, EventFunction )
|
function BASE:AddEvent( Event, EventFunction )
|
||||||
@ -215,7 +215,7 @@ end
|
|||||||
|
|
||||||
--- Returns the event dispatcher
|
--- Returns the event dispatcher
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @return Event#EVENT
|
-- @return Core.Event#EVENT
|
||||||
function BASE:Event()
|
function BASE:Event()
|
||||||
|
|
||||||
return _EVENTDISPATCHER
|
return _EVENTDISPATCHER
|
||||||
@ -563,8 +563,8 @@ local BaseEventCodes = {
|
|||||||
|
|
||||||
--- Creation of a Birth Event.
|
--- Creation of a Birth Event.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param DCSTypes#Time EventTime The time stamp of the event.
|
-- @param Dcs.DCSTypes#Time EventTime The time stamp of the event.
|
||||||
-- @param DCSObject#Object Initiator The initiating object of the event.
|
-- @param Dcs.DCSWrapper.Object#Object Initiator The initiating object of the event.
|
||||||
-- @param #string IniUnitName The initiating unit name.
|
-- @param #string IniUnitName The initiating unit name.
|
||||||
-- @param place
|
-- @param place
|
||||||
-- @param subplace
|
-- @param subplace
|
||||||
@ -585,8 +585,8 @@ end
|
|||||||
|
|
||||||
--- Creation of a Crash Event.
|
--- Creation of a Crash Event.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param DCSTypes#Time EventTime The time stamp of the event.
|
-- @param Dcs.DCSTypes#Time EventTime The time stamp of the event.
|
||||||
-- @param DCSObject#Object Initiator The initiating object of the event.
|
-- @param Dcs.DCSWrapper.Object#Object Initiator The initiating object of the event.
|
||||||
function BASE:CreateEventCrash( EventTime, Initiator )
|
function BASE:CreateEventCrash( EventTime, Initiator )
|
||||||
self:F( { EventTime, Initiator } )
|
self:F( { EventTime, Initiator } )
|
||||||
|
|
||||||
@ -599,10 +599,10 @@ function BASE:CreateEventCrash( EventTime, Initiator )
|
|||||||
world.onEvent( Event )
|
world.onEvent( Event )
|
||||||
end
|
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.
|
--- The main event handling function... This function captures all events generated for the class.
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param DCSTypes#Event event
|
-- @param Dcs.DCSTypes#Event event
|
||||||
function BASE:onEvent(event)
|
function BASE:onEvent(event)
|
||||||
--self:F( { BaseEventCodes[event.id], 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:
|
-- Mission designers can use the DATABASE class to refer to:
|
||||||
--
|
--
|
||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
--- DATABASE class
|
--- DATABASE class
|
||||||
-- @type DATABASE
|
-- @type DATABASE
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
DATABASE = {
|
DATABASE = {
|
||||||
ClassName = "DATABASE",
|
ClassName = "DATABASE",
|
||||||
Templates = {
|
Templates = {
|
||||||
@ -106,7 +106,7 @@ end
|
|||||||
--- Finds a Unit based on the Unit Name.
|
--- Finds a Unit based on the Unit Name.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string UnitName
|
-- @param #string UnitName
|
||||||
-- @return Unit#UNIT The found Unit.
|
-- @return Wrapper.Unit#UNIT The found Unit.
|
||||||
function DATABASE:FindUnit( UnitName )
|
function DATABASE:FindUnit( UnitName )
|
||||||
|
|
||||||
local UnitFound = self.UNITS[UnitName]
|
local UnitFound = self.UNITS[UnitName]
|
||||||
@ -154,7 +154,7 @@ end
|
|||||||
--- Finds a STATIC based on the StaticName.
|
--- Finds a STATIC based on the StaticName.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string StaticName
|
-- @param #string StaticName
|
||||||
-- @return Static#STATIC The found STATIC.
|
-- @return Wrapper.Static#STATIC The found STATIC.
|
||||||
function DATABASE:FindStatic( StaticName )
|
function DATABASE:FindStatic( StaticName )
|
||||||
|
|
||||||
local StaticFound = self.STATICS[StaticName]
|
local StaticFound = self.STATICS[StaticName]
|
||||||
@ -181,7 +181,7 @@ end
|
|||||||
--- Finds a AIRBASE based on the AirbaseName.
|
--- Finds a AIRBASE based on the AirbaseName.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string AirbaseName
|
-- @param #string AirbaseName
|
||||||
-- @return Airbase#AIRBASE The found AIRBASE.
|
-- @return Wrapper.Airbase#AIRBASE The found AIRBASE.
|
||||||
function DATABASE:FindAirbase( AirbaseName )
|
function DATABASE:FindAirbase( AirbaseName )
|
||||||
|
|
||||||
local AirbaseFound = self.AIRBASES[AirbaseName]
|
local AirbaseFound = self.AIRBASES[AirbaseName]
|
||||||
@ -192,7 +192,7 @@ end
|
|||||||
--- Finds a CLIENT based on the ClientName.
|
--- Finds a CLIENT based on the ClientName.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string ClientName
|
-- @param #string ClientName
|
||||||
-- @return Client#CLIENT The found CLIENT.
|
-- @return Wrapper.Client#CLIENT The found CLIENT.
|
||||||
function DATABASE:FindClient( ClientName )
|
function DATABASE:FindClient( ClientName )
|
||||||
|
|
||||||
local ClientFound = self.CLIENTS[ClientName]
|
local ClientFound = self.CLIENTS[ClientName]
|
||||||
@ -215,7 +215,7 @@ end
|
|||||||
--- Finds a GROUP based on the GroupName.
|
--- Finds a GROUP based on the GroupName.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param #string GroupName
|
-- @param #string GroupName
|
||||||
-- @return Group#GROUP The found GROUP.
|
-- @return Wrapper.Group#GROUP The found GROUP.
|
||||||
function DATABASE:FindGroup( GroupName )
|
function DATABASE:FindGroup( GroupName )
|
||||||
|
|
||||||
local GroupFound = self.GROUPS[GroupName]
|
local GroupFound = self.GROUPS[GroupName]
|
||||||
@ -535,7 +535,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnBirth event for the alive units set.
|
--- Handles the OnBirth event for the alive units set.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnBirth( Event )
|
function DATABASE:_EventOnBirth( Event )
|
||||||
self:F2( { Event } )
|
self:F2( { Event } )
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnDead or OnCrash event for alive units set.
|
--- Handles the OnDead or OnCrash event for alive units set.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnDeadOrCrash( Event )
|
function DATABASE:_EventOnDeadOrCrash( Event )
|
||||||
self:F2( { Event } )
|
self:F2( { Event } )
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnPlayerEnterUnit( Event )
|
function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||||
self:F2( { Event } )
|
self:F2( { Event } )
|
||||||
|
|
||||||
@ -579,7 +579,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||||
-- @param #DATABASE self
|
-- @param #DATABASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||||
self:F2( { Event } )
|
self:F2( { Event } )
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ end
|
|||||||
|
|
||||||
--- Initializes the Events structure for the event
|
--- Initializes the Events structure for the event
|
||||||
-- @param #EVENT self
|
-- @param #EVENT self
|
||||||
-- @param DCSWorld#world.event EventID
|
-- @param Dcs.DCSWorld#world.event EventID
|
||||||
-- @param Core.Base#BASE EventClass
|
-- @param Core.Base#BASE EventClass
|
||||||
-- @return #EVENT.Events
|
-- @return #EVENT.Events
|
||||||
function EVENT:Init( EventID, EventClass )
|
function EVENT:Init( EventID, EventClass )
|
||||||
@ -104,7 +104,7 @@ end
|
|||||||
--- Removes an Events entry
|
--- Removes an Events entry
|
||||||
-- @param #EVENT self
|
-- @param #EVENT self
|
||||||
-- @param Core.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 DCSWorld#world.event EventID
|
-- @param Dcs.DCSWorld#world.event EventID
|
||||||
-- @return #EVENT.Events
|
-- @return #EVENT.Events
|
||||||
function EVENT:Remove( EventClass, EventID )
|
function EVENT:Remove( EventClass, EventID )
|
||||||
self:F3( { EventClass, _EVENTCODES[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.
|
--- Set a new listener for an S_EVENT_X event independent from a unit or a weapon.
|
||||||
-- @param #EVENT self
|
-- @param #EVENT self
|
||||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
-- @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
|
-- @param EventID
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
function EVENT:OnEventGeneric( EventFunction, EventClass, EventID )
|
function EVENT:OnEventGeneric( EventFunction, EventClass, EventID )
|
||||||
@ -163,7 +163,7 @@ end
|
|||||||
-- @param #EVENT self
|
-- @param #EVENT self
|
||||||
-- @param #string EventDCSUnitName
|
-- @param #string EventDCSUnitName
|
||||||
-- @param #function EventFunction The function to be called when the event occurs for the unit.
|
-- @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
|
-- @param EventID
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
function EVENT:OnEventForUnit( EventDCSUnitName, EventFunction, EventClass, EventID )
|
function EVENT:OnEventForUnit( EventDCSUnitName, EventFunction, EventClass, EventID )
|
||||||
@ -183,7 +183,7 @@ do -- OnBirth
|
|||||||
|
|
||||||
--- Create an OnBirth event handler for a group
|
--- Create an OnBirth event handler for a group
|
||||||
-- @param #EVENT self
|
-- @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 #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.
|
-- @param EventClass The self instance of the class for which the event is.
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
@ -241,7 +241,7 @@ do -- OnCrash
|
|||||||
|
|
||||||
--- Create an OnCrash event handler for a group
|
--- Create an OnCrash event handler for a group
|
||||||
-- @param #EVENT self
|
-- @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 #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.
|
-- @param EventClass The self instance of the class for which the event is.
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
@ -298,7 +298,7 @@ do -- OnDead
|
|||||||
|
|
||||||
--- Create an OnDead event handler for a group
|
--- Create an OnDead event handler for a group
|
||||||
-- @param #EVENT self
|
-- @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 #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.
|
-- @param EventClass The self instance of the class for which the event is.
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
|
|||||||
@ -15,17 +15,17 @@
|
|||||||
--
|
--
|
||||||
-- ### To manage **main menus**, the classes begin with **MENU_**:
|
-- ### To manage **main menus**, the classes begin with **MENU_**:
|
||||||
--
|
--
|
||||||
-- * @{Menu#MENU_MISSION}: Manages main menus for whole mission file.
|
-- * @{Core.Menu#MENU_MISSION}: Manages main menus for whole mission file.
|
||||||
-- * @{Menu#MENU_COALITION}: Manages main menus for whole coalition.
|
-- * @{Core.Menu#MENU_COALITION}: Manages main menus for whole coalition.
|
||||||
-- * @{Menu#MENU_GROUP}: Manages main menus for GROUPs.
|
-- * @{Core.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_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_**:
|
-- ### 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.
|
-- * @{Core.Menu#MENU_MISSION_COMMAND}: Manages command menus for whole mission file.
|
||||||
-- * @{Menu#MENU_COALITION_COMMAND}: Manages command menus for whole coalition.
|
-- * @{Core.Menu#MENU_COALITION_COMMAND}: Manages command menus for whole coalition.
|
||||||
-- * @{Menu#MENU_GROUP_COMMAND}: Manages command menus for GROUPs.
|
-- * @{Core.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_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
|
-- These are simply abstract base classes defining a couple of fields that are used by the
|
||||||
-- derived MENU_ classes to manage menus.
|
-- 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.
|
-- 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.
|
-- 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.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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.
|
-- 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}.
|
-- 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.
|
-- 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}.
|
-- 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.
|
--- MENU_COALITION constructor. Creates a new MENU_COALITION object and creates the menu for a complete coalition.
|
||||||
-- @param #MENU_COALITION self
|
-- @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 #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).
|
-- @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
|
-- @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.
|
--- 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 #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 #string MenuText The text for the menu.
|
||||||
-- @param Menu#MENU_COALITION ParentMenu The parent menu.
|
-- @param Menu#MENU_COALITION ParentMenu The parent menu.
|
||||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||||
@ -493,7 +493,7 @@ do -- MENU_CLIENT
|
|||||||
-- MenuStatus[MenuClientName]:Remove()
|
-- MenuStatus[MenuClientName]:Remove()
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
-- --- @param Client#CLIENT MenuClient
|
-- --- @param Wrapper.Client#CLIENT MenuClient
|
||||||
-- local function AddStatusMenu( MenuClient )
|
-- local function AddStatusMenu( MenuClient )
|
||||||
-- local MenuClientName = MenuClient:GetName()
|
-- local MenuClientName = MenuClient:GetName()
|
||||||
-- -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
-- -- 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.
|
--- MENU_CLIENT constructor. Creates a new radio menu item for a client.
|
||||||
-- @param #MENU_CLIENT self
|
-- @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 #string MenuText The text for the menu.
|
||||||
-- @param #table ParentMenu The parent menu.
|
-- @param #table ParentMenu The parent menu.
|
||||||
-- @return #MENU_CLIENT self
|
-- @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.
|
--- 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 #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 #string MenuText The text for the menu.
|
||||||
-- @param #MENU_BASE ParentMenu The parent menu.
|
-- @param #MENU_BASE ParentMenu The parent menu.
|
||||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||||
@ -719,7 +719,7 @@ do
|
|||||||
-- MenuStatus[MenuGroupName]:Remove()
|
-- MenuStatus[MenuGroupName]:Remove()
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
-- --- @param Group#GROUP MenuGroup
|
-- --- @param Wrapper.Group#GROUP MenuGroup
|
||||||
-- local function AddStatusMenu( MenuGroup )
|
-- local function AddStatusMenu( MenuGroup )
|
||||||
-- local MenuGroupName = MenuGroup:GetName()
|
-- local MenuGroupName = MenuGroup:GetName()
|
||||||
-- -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
-- -- 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.
|
--- MENU_GROUP constructor. Creates a new radio menu item for a group.
|
||||||
-- @param #MENU_GROUP self
|
-- @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 #string MenuText The text for the menu.
|
||||||
-- @param #table ParentMenu The parent menu.
|
-- @param #table ParentMenu The parent menu.
|
||||||
-- @return #MENU_GROUP self
|
-- @return #MENU_GROUP self
|
||||||
@ -835,7 +835,7 @@ do
|
|||||||
|
|
||||||
--- Creates a new radio command item for a group
|
--- Creates a new radio command item for a group
|
||||||
-- @param #MENU_GROUP_COMMAND self
|
-- @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 MenuText The text for the menu.
|
||||||
-- @param ParentMenu The parent menu.
|
-- @param ParentMenu The parent menu.
|
||||||
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
-- @param CommandMenuFunction A function that is called when the menu key is pressed.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
--- This module contains the MESSAGE class.
|
--- 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.
|
-- Message System to display Messages to Clients, Coalitions or All.
|
||||||
-- Messages are shown on the display panel for an amount of seconds, and will then disappear.
|
-- Messages are shown on the display panel for an amount of seconds, and will then disappear.
|
||||||
@ -8,23 +8,23 @@
|
|||||||
--
|
--
|
||||||
-- 1.1) MESSAGE construction methods
|
-- 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.
|
-- To send messages, you need to use the To functions.
|
||||||
--
|
--
|
||||||
-- 1.2) Send messages with MESSAGE To methods
|
-- 1.2) Send messages with MESSAGE To methods
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Messages are sent to:
|
-- Messages are sent to:
|
||||||
--
|
--
|
||||||
-- * Clients with @{Message#MESSAGE.ToClient}.
|
-- * Clients with @{Core.Message#MESSAGE.ToClient}.
|
||||||
-- * Coalitions with @{Message#MESSAGE.ToCoalition}.
|
-- * Coalitions with @{Core.Message#MESSAGE.ToCoalition}.
|
||||||
-- * All Players with @{Message#MESSAGE.ToAll}.
|
-- * All Players with @{Core.Message#MESSAGE.ToAll}.
|
||||||
--
|
--
|
||||||
-- @module Message
|
-- @module Message
|
||||||
-- @author FlightControl
|
-- @author FlightControl
|
||||||
|
|
||||||
--- The MESSAGE class
|
--- The MESSAGE class
|
||||||
-- @type MESSAGE
|
-- @type MESSAGE
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
MESSAGE = {
|
MESSAGE = {
|
||||||
ClassName = "MESSAGE",
|
ClassName = "MESSAGE",
|
||||||
MessageCategory = 0,
|
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".
|
--- 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 #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
|
-- @return #MESSAGE
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Send the 2 messages created with the @{New} method to the Client Group.
|
-- -- Send the 2 messages created with the @{New} method to the Client Group.
|
||||||
@ -108,7 +108,7 @@ end
|
|||||||
|
|
||||||
--- Sends a MESSAGE to a Group.
|
--- Sends a MESSAGE to a Group.
|
||||||
-- @param #MESSAGE self
|
-- @param #MESSAGE self
|
||||||
-- @param Group#GROUP Group is the Group.
|
-- @param Wrapper.Group#GROUP Group is the Group.
|
||||||
-- @return #MESSAGE
|
-- @return #MESSAGE
|
||||||
function MESSAGE:ToGroup( Group )
|
function MESSAGE:ToGroup( Group )
|
||||||
self:F( Group.GroupName )
|
self:F( Group.GroupName )
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
--- This module contains the POINT classes.
|
--- 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.
|
-- **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.
|
-- 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:
|
-- A new POINT_VEC3 instance can be created with:
|
||||||
--
|
--
|
||||||
-- * @{#POINT_VEC3.New}(): a 3D point.
|
-- * @{#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
|
-- 2.1) POINT_VEC2 constructor
|
||||||
-- ---------------------------
|
-- ---------------------------
|
||||||
-- A new POINT_VEC2 instance can be created with:
|
-- A new POINT_VEC2 instance can be created with:
|
||||||
--
|
--
|
||||||
-- * @{#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
|
-- * @{#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
|
--- The POINT_VEC3 class
|
||||||
-- @type POINT_VEC3
|
-- @type POINT_VEC3
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
-- @field #number x The x coordinate in 3D space.
|
-- @field #number x The x coordinate in 3D space.
|
||||||
-- @field #number y The y coordinate in 3D space.
|
-- @field #number y The y coordinate in 3D space.
|
||||||
-- @field #number z The z coordiante in 3D space.
|
-- @field #number z The z coordiante in 3D space.
|
||||||
-- @field #POINT_VEC3.SmokeColor SmokeColor
|
-- @field #POINT_VEC3.SmokeColor SmokeColor
|
||||||
-- @field Utils#FLARECOLOR FlareColor
|
-- @field Utilities.Utils#FLARECOLOR FlareColor
|
||||||
-- @field #POINT_VEC3.RoutePointAltType RoutePointAltType
|
-- @field #POINT_VEC3.RoutePointAltType RoutePointAltType
|
||||||
-- @field #POINT_VEC3.RoutePointType RoutePointType
|
-- @field #POINT_VEC3.RoutePointType RoutePointType
|
||||||
-- @field #POINT_VEC3.RoutePointAction RoutePointAction
|
-- @field #POINT_VEC3.RoutePointAction RoutePointAction
|
||||||
@ -84,8 +84,8 @@ POINT_VEC3 = {
|
|||||||
--- The POINT_VEC2 class
|
--- The POINT_VEC2 class
|
||||||
-- @type POINT_VEC2
|
-- @type POINT_VEC2
|
||||||
-- @extends #POINT_VEC3
|
-- @extends #POINT_VEC3
|
||||||
-- @field DCSTypes#Distance x The x coordinate in meters.
|
-- @field Dcs.DCSTypes#Distance x The x coordinate in meters.
|
||||||
-- @field DCSTypes#Distance y the y coordinate in meters.
|
-- @field Dcs.DCSTypes#Distance y the y coordinate in meters.
|
||||||
POINT_VEC2 = {
|
POINT_VEC2 = {
|
||||||
ClassName = "POINT_VEC2",
|
ClassName = "POINT_VEC2",
|
||||||
}
|
}
|
||||||
@ -109,10 +109,10 @@ do -- POINT_VEC3
|
|||||||
|
|
||||||
--- Create a new POINT_VEC3 object.
|
--- Create a new POINT_VEC3 object.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
-- @param Dcs.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 Dcs.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.
|
-- @param Dcs.DCSTypes#Distance z The z coordinate of the Vec3 point, pointing to the Right.
|
||||||
-- @return Point#POINT_VEC3 self
|
-- @return Core.Point#POINT_VEC3 self
|
||||||
function POINT_VEC3:New( x, y, z )
|
function POINT_VEC3:New( x, y, z )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
@ -125,8 +125,8 @@ end
|
|||||||
|
|
||||||
--- Create a new POINT_VEC3 object from Vec3 coordinates.
|
--- Create a new POINT_VEC3 object from Vec3 coordinates.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Vec3 Vec3 The Vec3 point.
|
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||||
-- @return Point#POINT_VEC3 self
|
-- @return Core.Point#POINT_VEC3 self
|
||||||
function POINT_VEC3:NewFromVec3( Vec3 )
|
function POINT_VEC3:NewFromVec3( Vec3 )
|
||||||
|
|
||||||
self = self:New( Vec3.x, Vec3.y, Vec3.z )
|
self = self:New( Vec3.x, Vec3.y, Vec3.z )
|
||||||
@ -137,14 +137,14 @@ end
|
|||||||
|
|
||||||
--- Return the coordinates of the POINT_VEC3 in Vec3 format.
|
--- Return the coordinates of the POINT_VEC3 in Vec3 format.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @return DCSTypes#Vec3 The Vec3 coodinate.
|
-- @return Dcs.DCSTypes#Vec3 The Vec3 coodinate.
|
||||||
function POINT_VEC3:GetVec3()
|
function POINT_VEC3:GetVec3()
|
||||||
return { x = self.x, y = self.y, z = self.z }
|
return { x = self.x, y = self.y, z = self.z }
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return the coordinates of the POINT_VEC3 in Vec2 format.
|
--- Return the coordinates of the POINT_VEC3 in Vec2 format.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @return DCSTypes#Vec2 The Vec2 coodinate.
|
-- @return Dcs.DCSTypes#Vec2 The Vec2 coodinate.
|
||||||
function POINT_VEC3:GetVec2()
|
function POINT_VEC3:GetVec2()
|
||||||
return { x = self.x, y = self.z }
|
return { x = self.x, y = self.z }
|
||||||
end
|
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.
|
--- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance OuterRadius
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
-- @param DCSTypes#Distance InnerRadius
|
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||||
-- @return DCSTypes#Vec2 Vec2
|
-- @return Dcs.DCSTypes#Vec2 Vec2
|
||||||
function POINT_VEC3:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
function POINT_VEC3:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
||||||
self:F2( { 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.
|
--- 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 #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance OuterRadius
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
-- @param DCSTypes#Distance InnerRadius
|
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||||
-- @return #POINT_VEC2
|
-- @return #POINT_VEC2
|
||||||
function POINT_VEC3:GetRandomPointVec2InRadius( OuterRadius, InnerRadius )
|
function POINT_VEC3:GetRandomPointVec2InRadius( OuterRadius, InnerRadius )
|
||||||
self:F2( { 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.
|
--- Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance OuterRadius
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
-- @param DCSTypes#Distance InnerRadius
|
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||||
-- @return DCSTypes#Vec3 Vec3
|
-- @return Dcs.DCSTypes#Vec3 Vec3
|
||||||
function POINT_VEC3:GetRandomVec3InRadius( OuterRadius, InnerRadius )
|
function POINT_VEC3:GetRandomVec3InRadius( OuterRadius, InnerRadius )
|
||||||
|
|
||||||
local RandomVec2 = self:GetRandomVec2InRadius( 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.
|
--- 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 #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance OuterRadius
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
-- @param DCSTypes#Distance InnerRadius
|
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||||
-- @return #POINT_VEC3
|
-- @return #POINT_VEC3
|
||||||
function POINT_VEC3:GetRandomPointVec3InRadius( OuterRadius, InnerRadius )
|
function POINT_VEC3:GetRandomPointVec3InRadius( OuterRadius, InnerRadius )
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ end
|
|||||||
--- Return a direction vector Vec3 from POINT_VEC3 to the POINT_VEC3.
|
--- Return a direction vector Vec3 from POINT_VEC3 to the POINT_VEC3.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
-- @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 )
|
function POINT_VEC3:GetDirectionVec3( TargetPointVec3 )
|
||||||
return { x = TargetPointVec3:GetX() - self:GetX(), y = TargetPointVec3:GetY() - self:GetY(), z = TargetPointVec3:GetZ() - self:GetZ() }
|
return { x = TargetPointVec3:GetX() - self:GetX(), y = TargetPointVec3:GetY() - self:GetY(), z = TargetPointVec3:GetZ() - self:GetZ() }
|
||||||
end
|
end
|
||||||
@ -277,7 +277,7 @@ end
|
|||||||
|
|
||||||
--- Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.
|
--- Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.
|
||||||
-- @param #POINT_VEC3 self
|
-- @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.
|
-- @return #number DirectionRadians The direction in radians.
|
||||||
function POINT_VEC3:GetDirectionRadians( DirectionVec3 )
|
function POINT_VEC3:GetDirectionRadians( DirectionVec3 )
|
||||||
local DirectionRadians = math.atan2( DirectionVec3.z, DirectionVec3.x )
|
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.
|
--- Return the 2D distance in meters between the target POINT_VEC3 and the POINT_VEC3.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
-- @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 )
|
function POINT_VEC3:Get2DDistance( TargetPointVec3 )
|
||||||
local TargetVec3 = TargetPointVec3:GetVec3()
|
local TargetVec3 = TargetPointVec3:GetVec3()
|
||||||
local SourceVec3 = self: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.
|
--- Return the 3D distance in meters between the target POINT_VEC3 and the POINT_VEC3.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param #POINT_VEC3 TargetPointVec3 The target POINT_VEC3.
|
-- @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 )
|
function POINT_VEC3:Get3DDistance( TargetPointVec3 )
|
||||||
local TargetVec3 = TargetPointVec3:GetVec3()
|
local TargetVec3 = TargetPointVec3:GetVec3()
|
||||||
local SourceVec3 = self: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.
|
--- 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 #POINT_VEC3 self
|
||||||
-- @param DCSTypes#Distance Distance The Distance to be added in meters.
|
-- @param Dcs.DCSTypes#Distance Distance The Distance to be added in meters.
|
||||||
-- @param DCSTypes#Angle Angle The Angle in degrees.
|
-- @param Dcs.DCSTypes#Angle Angle The Angle in degrees.
|
||||||
-- @return #POINT_VEC3 The new calculated POINT_VEC3.
|
-- @return #POINT_VEC3 The new calculated POINT_VEC3.
|
||||||
function POINT_VEC3:Translate( Distance, Angle )
|
function POINT_VEC3:Translate( Distance, Angle )
|
||||||
local SX = self:GetX()
|
local SX = self:GetX()
|
||||||
@ -399,7 +399,7 @@ end
|
|||||||
-- @param #POINT_VEC3.RoutePointAltType AltType The altitude type.
|
-- @param #POINT_VEC3.RoutePointAltType AltType The altitude type.
|
||||||
-- @param #POINT_VEC3.RoutePointType Type The route point type.
|
-- @param #POINT_VEC3.RoutePointType Type The route point type.
|
||||||
-- @param #POINT_VEC3.RoutePointAction Action The route point action.
|
-- @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.
|
-- @param #boolean SpeedLocked true means the speed is locked.
|
||||||
-- @return #table The route point.
|
-- @return #table The route point.
|
||||||
function POINT_VEC3:RoutePointAir( AltType, Type, Action, Speed, SpeedLocked )
|
function POINT_VEC3:RoutePointAir( AltType, Type, Action, Speed, SpeedLocked )
|
||||||
@ -440,7 +440,7 @@ end
|
|||||||
|
|
||||||
--- Build an ground type route point.
|
--- Build an ground type route point.
|
||||||
-- @param #POINT_VEC3 self
|
-- @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.
|
-- @param #POINT_VEC3.RoutePointAction Formation The route point Formation.
|
||||||
-- @return #table The route point.
|
-- @return #table The route point.
|
||||||
function POINT_VEC3:RoutePointGround( Speed, Formation )
|
function POINT_VEC3:RoutePointGround( Speed, Formation )
|
||||||
@ -480,7 +480,7 @@ end
|
|||||||
|
|
||||||
--- Smokes the point in a color.
|
--- Smokes the point in a color.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param Utils#SMOKECOLOR SmokeColor
|
-- @param Utilities.Utils#SMOKECOLOR SmokeColor
|
||||||
function POINT_VEC3:Smoke( SmokeColor )
|
function POINT_VEC3:Smoke( SmokeColor )
|
||||||
self:F2( { SmokeColor } )
|
self:F2( { SmokeColor } )
|
||||||
trigger.action.smoke( self:GetVec3(), SmokeColor )
|
trigger.action.smoke( self:GetVec3(), SmokeColor )
|
||||||
@ -523,8 +523,8 @@ end
|
|||||||
|
|
||||||
--- Flares the point in a color.
|
--- Flares the point in a color.
|
||||||
-- @param #POINT_VEC3 self
|
-- @param #POINT_VEC3 self
|
||||||
-- @param Utils#FLARECOLOR FlareColor
|
-- @param Utilities.Utils#FLARECOLOR FlareColor
|
||||||
-- @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:Flare( FlareColor, Azimuth )
|
function POINT_VEC3:Flare( FlareColor, Azimuth )
|
||||||
self:F2( { FlareColor } )
|
self:F2( { FlareColor } )
|
||||||
trigger.action.signalFlare( self:GetVec3(), FlareColor, Azimuth and Azimuth or 0 )
|
trigger.action.signalFlare( self:GetVec3(), FlareColor, Azimuth and Azimuth or 0 )
|
||||||
@ -532,7 +532,7 @@ end
|
|||||||
|
|
||||||
--- Flare the POINT_VEC3 White.
|
--- Flare the POINT_VEC3 White.
|
||||||
-- @param #POINT_VEC3 self
|
-- @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 )
|
function POINT_VEC3:FlareWhite( Azimuth )
|
||||||
self:F2( Azimuth )
|
self:F2( Azimuth )
|
||||||
self:Flare( FLARECOLOR.White, Azimuth )
|
self:Flare( FLARECOLOR.White, Azimuth )
|
||||||
@ -540,7 +540,7 @@ end
|
|||||||
|
|
||||||
--- Flare the POINT_VEC3 Yellow.
|
--- Flare the POINT_VEC3 Yellow.
|
||||||
-- @param #POINT_VEC3 self
|
-- @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 )
|
function POINT_VEC3:FlareYellow( Azimuth )
|
||||||
self:F2( Azimuth )
|
self:F2( Azimuth )
|
||||||
self:Flare( FLARECOLOR.Yellow, Azimuth )
|
self:Flare( FLARECOLOR.Yellow, Azimuth )
|
||||||
@ -548,7 +548,7 @@ end
|
|||||||
|
|
||||||
--- Flare the POINT_VEC3 Green.
|
--- Flare the POINT_VEC3 Green.
|
||||||
-- @param #POINT_VEC3 self
|
-- @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 )
|
function POINT_VEC3:FlareGreen( Azimuth )
|
||||||
self:F2( Azimuth )
|
self:F2( Azimuth )
|
||||||
self:Flare( FLARECOLOR.Green, Azimuth )
|
self:Flare( FLARECOLOR.Green, Azimuth )
|
||||||
@ -569,10 +569,10 @@ do -- POINT_VEC2
|
|||||||
|
|
||||||
--- POINT_VEC2 constructor.
|
--- POINT_VEC2 constructor.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
-- @param Dcs.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 Dcs.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.
|
-- @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 Point#POINT_VEC2
|
-- @return Core.Point#POINT_VEC2
|
||||||
function POINT_VEC2:New( x, y, LandHeightAdd )
|
function POINT_VEC2:New( x, y, LandHeightAdd )
|
||||||
|
|
||||||
local LandHeight = land.getHeight( { ["x"] = x, ["y"] = y } )
|
local LandHeight = land.getHeight( { ["x"] = x, ["y"] = y } )
|
||||||
@ -588,8 +588,8 @@ end
|
|||||||
|
|
||||||
--- Create a new POINT_VEC2 object from Vec2 coordinates.
|
--- Create a new POINT_VEC2 object from Vec2 coordinates.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param DCSTypes#Vec2 Vec2 The Vec2 point.
|
-- @param Dcs.DCSTypes#Vec2 Vec2 The Vec2 point.
|
||||||
-- @return Point#POINT_VEC2 self
|
-- @return Core.Point#POINT_VEC2 self
|
||||||
function POINT_VEC2:NewFromVec2( Vec2, LandHeightAdd )
|
function POINT_VEC2:NewFromVec2( Vec2, LandHeightAdd )
|
||||||
|
|
||||||
local LandHeight = land.getHeight( Vec2 )
|
local LandHeight = land.getHeight( Vec2 )
|
||||||
@ -605,8 +605,8 @@ end
|
|||||||
|
|
||||||
--- Create a new POINT_VEC2 object from Vec3 coordinates.
|
--- Create a new POINT_VEC2 object from Vec3 coordinates.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param DCSTypes#Vec3 Vec3 The Vec3 point.
|
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||||
-- @return Point#POINT_VEC2 self
|
-- @return Core.Point#POINT_VEC2 self
|
||||||
function POINT_VEC2:NewFromVec3( Vec3 )
|
function POINT_VEC2:NewFromVec3( Vec3 )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
@ -658,7 +658,7 @@ end
|
|||||||
--- Calculate the distance from a reference @{#POINT_VEC2}.
|
--- Calculate the distance from a reference @{#POINT_VEC2}.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param #POINT_VEC2 PointVec2Reference The reference @{#POINT_VEC2}.
|
-- @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 )
|
function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||||
self:F2( PointVec2Reference )
|
self:F2( PointVec2Reference )
|
||||||
|
|
||||||
@ -668,10 +668,10 @@ function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
|||||||
return Distance
|
return Distance
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Calculate the distance from a reference @{DCSTypes#Vec2}.
|
--- Calculate the distance from a reference @{Dcs.DCSTypes#Vec2}.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param DCSTypes#Vec2 Vec2Reference The reference @{DCSTypes#Vec2}.
|
-- @param Dcs.DCSTypes#Vec2 Vec2Reference The reference @{Dcs.DCSTypes#Vec2}.
|
||||||
-- @return DCSTypes#Distance The distance from the reference @{DCSTypes#Vec2} in meters.
|
-- @return Dcs.DCSTypes#Distance The distance from the reference @{Dcs.DCSTypes#Vec2} in meters.
|
||||||
function POINT_VEC2:DistanceFromVec2( Vec2Reference )
|
function POINT_VEC2:DistanceFromVec2( Vec2Reference )
|
||||||
self:F2( 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.
|
--- 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 #POINT_VEC2 self
|
||||||
-- @param DCSTypes#Distance Distance The Distance to be added in meters.
|
-- @param Dcs.DCSTypes#Distance Distance The Distance to be added in meters.
|
||||||
-- @param DCSTypes#Angle Angle The Angle in degrees.
|
-- @param Dcs.DCSTypes#Angle Angle The Angle in degrees.
|
||||||
-- @return #POINT_VEC2 The new calculated POINT_VEC2.
|
-- @return #POINT_VEC2 The new calculated POINT_VEC2.
|
||||||
function POINT_VEC2:Translate( Distance, Angle )
|
function POINT_VEC2:Translate( Distance, Angle )
|
||||||
local SX = self:GetX()
|
local SX = self:GetX()
|
||||||
|
|||||||
@ -1,25 +1,25 @@
|
|||||||
--- This module contains the SCHEDULER class.
|
--- 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
|
-- 1.1) SCHEDULER constructor
|
||||||
-- --------------------------
|
-- --------------------------
|
||||||
-- The SCHEDULER class is quite easy to use:
|
-- 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
|
-- 1.2) SCHEDULER timer stop and start
|
||||||
-- -----------------------------------
|
-- -----------------------------------
|
||||||
-- The SCHEDULER can be stopped and restarted with the following methods:
|
-- The SCHEDULER can be stopped and restarted with the following methods:
|
||||||
--
|
--
|
||||||
-- * @{Scheduler#SCHEDULER.Start}: (Re-)Start the scheduler.
|
-- * @{Core.Scheduler#SCHEDULER.Start}: (Re-)Start the scheduler.
|
||||||
-- * @{Scheduler#SCHEDULER.Stop}: Stop the scheduler.
|
-- * @{Core.Scheduler#SCHEDULER.Stop}: Stop the scheduler.
|
||||||
--
|
--
|
||||||
-- 1.3) Reschedule new time event
|
-- 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
|
--- The SCHEDULER class
|
||||||
-- @type SCHEDULER
|
-- @type SCHEDULER
|
||||||
-- @field #number ScheduleID the ID of the scheduler.
|
-- @field #number ScheduleID the ID of the scheduler.
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
SCHEDULER = {
|
SCHEDULER = {
|
||||||
ClassName = "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.
|
-- 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.
|
-- 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.
|
-- The default **"yield interval"** is after 10 objects processed.
|
||||||
@ -12,18 +12,18 @@
|
|||||||
--
|
--
|
||||||
-- 1.1) Add or remove objects from the SET
|
-- 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"**
|
-- 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).
|
-- 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
|
-- * Coalitions
|
||||||
-- * Categories
|
-- * Categories
|
||||||
@ -38,7 +38,7 @@
|
|||||||
--
|
--
|
||||||
-- 2.2) Add or Remove GROUP(s) from SET_GROUP:
|
-- 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.
|
-- 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:
|
-- 2.3) SET_GROUP filter criteria:
|
||||||
@ -57,7 +57,7 @@
|
|||||||
--
|
--
|
||||||
-- Planned filter criteria within development are (so these are not yet available):
|
-- 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:
|
-- 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
|
-- * Coalitions
|
||||||
-- * Categories
|
-- * Categories
|
||||||
@ -90,7 +90,7 @@
|
|||||||
--
|
--
|
||||||
-- 3.2) Add or Remove UNIT(s) from SET_UNIT:
|
-- 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.
|
-- 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:
|
-- 3.3) SET_UNIT filter criteria:
|
||||||
@ -110,7 +110,7 @@
|
|||||||
--
|
--
|
||||||
-- Planned filter criteria within development are (so these are not yet available):
|
-- 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:
|
-- 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
|
-- * Coalitions
|
||||||
-- * Categories
|
-- * Categories
|
||||||
@ -148,7 +148,7 @@
|
|||||||
--
|
--
|
||||||
-- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
|
-- 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.
|
-- 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:
|
-- 4.3) SET_CLIENT filter criteria:
|
||||||
@ -168,7 +168,7 @@
|
|||||||
--
|
--
|
||||||
-- Planned filter criteria within development are (so these are not yet available):
|
-- 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:
|
-- 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
|
-- * Coalitions
|
||||||
--
|
--
|
||||||
@ -194,7 +194,7 @@
|
|||||||
--
|
--
|
||||||
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
|
-- 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.
|
-- 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
|
-- 5.3) SET_AIRBASE filter criteria
|
||||||
@ -233,7 +233,7 @@
|
|||||||
-- @field #table Filter
|
-- @field #table Filter
|
||||||
-- @field #table Set
|
-- @field #table Set
|
||||||
-- @field #table List
|
-- @field #table List
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
SET_BASE = {
|
SET_BASE = {
|
||||||
ClassName = "SET_BASE",
|
ClassName = "SET_BASE",
|
||||||
Filter = {},
|
Filter = {},
|
||||||
@ -264,10 +264,10 @@ function SET_BASE:New( Database )
|
|||||||
return self
|
return self
|
||||||
end
|
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 #SET_BASE self
|
||||||
-- @param #string ObjectName
|
-- @param #string ObjectName
|
||||||
-- @return Base#BASE The Object found.
|
-- @return Core.Base#BASE The Object found.
|
||||||
function SET_BASE:_Find( ObjectName )
|
function SET_BASE:_Find( ObjectName )
|
||||||
|
|
||||||
local ObjectFound = self.Set[ObjectName]
|
local ObjectFound = self.Set[ObjectName]
|
||||||
@ -284,11 +284,11 @@ function SET_BASE:GetSet()
|
|||||||
return self.Set
|
return self.Set
|
||||||
end
|
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 #SET_BASE self
|
||||||
-- @param #string ObjectName
|
-- @param #string ObjectName
|
||||||
-- @param Base#BASE Object
|
-- @param Core.Base#BASE Object
|
||||||
-- @return Base#BASE The added BASE Object.
|
-- @return Core.Base#BASE The added BASE Object.
|
||||||
function SET_BASE:Add( ObjectName, Object )
|
function SET_BASE:Add( ObjectName, Object )
|
||||||
self:F2( ObjectName )
|
self:F2( ObjectName )
|
||||||
|
|
||||||
@ -310,10 +310,10 @@ function SET_BASE:Add( ObjectName, Object )
|
|||||||
|
|
||||||
end
|
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 #SET_BASE self
|
||||||
-- @param Object#OBJECT Object
|
-- @param Wrapper.Object#OBJECT Object
|
||||||
-- @return Base#BASE The added BASE Object.
|
-- @return Core.Base#BASE The added BASE Object.
|
||||||
function SET_BASE:AddObject( Object )
|
function SET_BASE:AddObject( Object )
|
||||||
self:F2( Object.ObjectName )
|
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 #SET_BASE self
|
||||||
-- @param #string ObjectName
|
-- @param #string ObjectName
|
||||||
function SET_BASE:Remove( ObjectName )
|
function SET_BASE:Remove( ObjectName )
|
||||||
@ -364,10 +364,10 @@ function SET_BASE:Remove( ObjectName )
|
|||||||
|
|
||||||
end
|
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 #SET_BASE self
|
||||||
-- @param #string ObjectName
|
-- @param #string ObjectName
|
||||||
-- @return Base#BASE
|
-- @return Core.Base#BASE
|
||||||
function SET_BASE:Get( ObjectName )
|
function SET_BASE:Get( ObjectName )
|
||||||
self:F( ObjectName )
|
self:F( ObjectName )
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ function SET_BASE:Get( ObjectName )
|
|||||||
|
|
||||||
end
|
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
|
-- @param #SET_BASE self
|
||||||
-- @return #number Count
|
-- @return #number Count
|
||||||
function SET_BASE:Count()
|
function SET_BASE:Count()
|
||||||
@ -472,10 +472,10 @@ function SET_BASE:FilterStop()
|
|||||||
return self
|
return self
|
||||||
end
|
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 #SET_BASE self
|
||||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||||
-- @return Base#BASE The closest object.
|
-- @return Core.Base#BASE The closest object.
|
||||||
function SET_BASE:FindNearestObjectFromPointVec2( PointVec2 )
|
function SET_BASE:FindNearestObjectFromPointVec2( PointVec2 )
|
||||||
self:F2( PointVec2 )
|
self:F2( PointVec2 )
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnBirth event for the Set.
|
--- Handles the OnBirth event for the Set.
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SET_BASE:_EventOnBirth( Event )
|
function SET_BASE:_EventOnBirth( Event )
|
||||||
self:F3( { Event } )
|
self:F3( { Event } )
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnDead or OnCrash event for alive units set.
|
--- Handles the OnDead or OnCrash event for alive units set.
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SET_BASE:_EventOnDeadOrCrash( Event )
|
function SET_BASE:_EventOnDeadOrCrash( Event )
|
||||||
self:F3( { Event } )
|
self:F3( { Event } )
|
||||||
|
|
||||||
@ -556,7 +556,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
--- Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SET_BASE:_EventOnPlayerEnterUnit( Event )
|
function SET_BASE:_EventOnPlayerEnterUnit( Event )
|
||||||
self:F3( { Event } )
|
self:F3( { Event } )
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
--- Handles the OnPlayerLeaveUnit event to clean the active players table.
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SET_BASE:_EventOnPlayerLeaveUnit( Event )
|
function SET_BASE:_EventOnPlayerLeaveUnit( Event )
|
||||||
self:F3( { Event } )
|
self:F3( { Event } )
|
||||||
|
|
||||||
@ -761,7 +761,7 @@ function SET_GROUP:New()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Add GROUP(s) to SET_GROUP.
|
--- 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.
|
-- @param #string AddGroupNames A single name or an array of GROUP names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_GROUP:AddGroupsByName( AddGroupNames )
|
function SET_GROUP:AddGroupsByName( AddGroupNames )
|
||||||
@ -776,8 +776,8 @@ function SET_GROUP:AddGroupsByName( AddGroupNames )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Remove GROUP(s) from SET_GROUP.
|
--- Remove GROUP(s) from SET_GROUP.
|
||||||
-- @param Set#SET_GROUP self
|
-- @param Core.Set#SET_GROUP self
|
||||||
-- @param Group#GROUP RemoveGroupNames A single name or an array of GROUP names.
|
-- @param Wrapper.Group#GROUP RemoveGroupNames A single name or an array of GROUP names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_GROUP:RemoveGroupsByName( RemoveGroupNames )
|
function SET_GROUP:RemoveGroupsByName( RemoveGroupNames )
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ end
|
|||||||
--- Finds a Group based on the Group Name.
|
--- Finds a Group based on the Group Name.
|
||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @param #string GroupName
|
-- @param #string GroupName
|
||||||
-- @return Group#GROUP The found Group.
|
-- @return Wrapper.Group#GROUP The found Group.
|
||||||
function SET_GROUP:FindGroup( GroupName )
|
function SET_GROUP:FindGroup( GroupName )
|
||||||
|
|
||||||
local GroupFound = self.Set[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.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the GROUP
|
-- @return #string The name of the GROUP
|
||||||
-- @return #table The GROUP
|
-- @return #table The GROUP
|
||||||
function SET_GROUP:AddInDatabase( Event )
|
function SET_GROUP:AddInDatabase( Event )
|
||||||
@ -914,7 +914,7 @@ end
|
|||||||
--- Handles the Database to check on any event that Object exists in the Database.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the GROUP
|
-- @return #string The name of the GROUP
|
||||||
-- @return #table The GROUP
|
-- @return #table The GROUP
|
||||||
function SET_GROUP:FindInDatabase( Event )
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_GROUP self
|
||||||
function SET_GROUP:ForEachGroupCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
function SET_GROUP:ForEachGroupCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -945,7 +945,7 @@ function SET_GROUP:ForEachGroupCompletelyInZone( ZoneObject, IteratorFunction, .
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Group#GROUP GroupObject
|
-- @param Wrapper.Group#GROUP GroupObject
|
||||||
function( ZoneObject, GroupObject )
|
function( ZoneObject, GroupObject )
|
||||||
if GroupObject:IsCompletelyInZone( ZoneObject ) then
|
if GroupObject:IsCompletelyInZone( ZoneObject ) then
|
||||||
return true
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_GROUP self
|
||||||
function SET_GROUP:ForEachGroupPartlyInZone( ZoneObject, IteratorFunction, ... )
|
function SET_GROUP:ForEachGroupPartlyInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -967,7 +967,7 @@ function SET_GROUP:ForEachGroupPartlyInZone( ZoneObject, IteratorFunction, ... )
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Group#GROUP GroupObject
|
-- @param Wrapper.Group#GROUP GroupObject
|
||||||
function( ZoneObject, GroupObject )
|
function( ZoneObject, GroupObject )
|
||||||
if GroupObject:IsPartlyInZone( ZoneObject ) then
|
if GroupObject:IsPartlyInZone( ZoneObject ) then
|
||||||
return true
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_GROUP self
|
||||||
function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -989,7 +989,7 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Group#GROUP GroupObject
|
-- @param Wrapper.Group#GROUP GroupObject
|
||||||
function( ZoneObject, GroupObject )
|
function( ZoneObject, GroupObject )
|
||||||
if GroupObject:IsNotInZone( ZoneObject ) then
|
if GroupObject:IsNotInZone( ZoneObject ) then
|
||||||
return true
|
return true
|
||||||
@ -1030,7 +1030,7 @@ end
|
|||||||
|
|
||||||
---
|
---
|
||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @param Group#GROUP MooseGroup
|
-- @param Wrapper.Group#GROUP MooseGroup
|
||||||
-- @return #SET_GROUP self
|
-- @return #SET_GROUP self
|
||||||
function SET_GROUP:IsIncludeObject( MooseGroup )
|
function SET_GROUP:IsIncludeObject( MooseGroup )
|
||||||
self:F2( MooseGroup )
|
self:F2( MooseGroup )
|
||||||
@ -1086,7 +1086,7 @@ end
|
|||||||
|
|
||||||
--- SET_UNIT class
|
--- SET_UNIT class
|
||||||
-- @type SET_UNIT
|
-- @type SET_UNIT
|
||||||
-- @extends Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
SET_UNIT = {
|
SET_UNIT = {
|
||||||
ClassName = "SET_UNIT",
|
ClassName = "SET_UNIT",
|
||||||
Units = {},
|
Units = {},
|
||||||
@ -1158,8 +1158,8 @@ function SET_UNIT:AddUnitsByName( AddUnitNames )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Remove UNIT(s) from SET_UNIT.
|
--- Remove UNIT(s) from SET_UNIT.
|
||||||
-- @param Set#SET_UNIT self
|
-- @param Core.Set#SET_UNIT self
|
||||||
-- @param Unit#UNIT RemoveUnitNames A single name or an array of UNIT names.
|
-- @param Wrapper.Unit#UNIT RemoveUnitNames A single name or an array of UNIT names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_UNIT:RemoveUnitsByName( RemoveUnitNames )
|
function SET_UNIT:RemoveUnitsByName( RemoveUnitNames )
|
||||||
|
|
||||||
@ -1176,7 +1176,7 @@ end
|
|||||||
--- Finds a Unit based on the Unit Name.
|
--- Finds a Unit based on the Unit Name.
|
||||||
-- @param #SET_UNIT self
|
-- @param #SET_UNIT self
|
||||||
-- @param #string UnitName
|
-- @param #string UnitName
|
||||||
-- @return Unit#UNIT The found Unit.
|
-- @return Wrapper.Unit#UNIT The found Unit.
|
||||||
function SET_UNIT:FindUnit( UnitName )
|
function SET_UNIT:FindUnit( UnitName )
|
||||||
|
|
||||||
local UnitFound = self.Set[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.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
-- @param #SET_UNIT self
|
-- @param #SET_UNIT self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the UNIT
|
-- @return #string The name of the UNIT
|
||||||
-- @return #table The UNIT
|
-- @return #table The UNIT
|
||||||
function SET_UNIT:AddInDatabase( Event )
|
function SET_UNIT:AddInDatabase( Event )
|
||||||
@ -1339,7 +1339,7 @@ end
|
|||||||
--- Handles the Database to check on any event that Object exists in the Database.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||||
-- @param #SET_UNIT self
|
-- @param #SET_UNIT self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the UNIT
|
-- @return #string The name of the UNIT
|
||||||
-- @return #table The UNIT
|
-- @return #table The UNIT
|
||||||
function SET_UNIT:FindInDatabase( Event )
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_UNIT self
|
||||||
function SET_UNIT:ForEachUnitCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
function SET_UNIT:ForEachUnitCompletelyInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -1371,7 +1371,7 @@ function SET_UNIT:ForEachUnitCompletelyInZone( ZoneObject, IteratorFunction, ...
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Unit#UNIT UnitObject
|
-- @param Wrapper.Unit#UNIT UnitObject
|
||||||
function( ZoneObject, UnitObject )
|
function( ZoneObject, UnitObject )
|
||||||
if UnitObject:IsCompletelyInZone( ZoneObject ) then
|
if UnitObject:IsCompletelyInZone( ZoneObject ) then
|
||||||
return true
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_UNIT self
|
||||||
function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
|
function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -1393,7 +1393,7 @@ function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Unit#UNIT UnitObject
|
-- @param Wrapper.Unit#UNIT UnitObject
|
||||||
function( ZoneObject, UnitObject )
|
function( ZoneObject, UnitObject )
|
||||||
if UnitObject:IsNotInZone( ZoneObject ) then
|
if UnitObject:IsNotInZone( ZoneObject ) then
|
||||||
return true
|
return true
|
||||||
@ -1415,7 +1415,7 @@ function SET_UNIT:GetUnitTypes()
|
|||||||
local UnitTypes = {}
|
local UnitTypes = {}
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetSet() ) do
|
for UnitID, UnitData in pairs( self:GetSet() ) do
|
||||||
local TextUnit = UnitData -- Unit#UNIT
|
local TextUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if TextUnit:IsAlive() then
|
if TextUnit:IsAlive() then
|
||||||
local UnitType = TextUnit:GetTypeName()
|
local UnitType = TextUnit:GetTypeName()
|
||||||
|
|
||||||
@ -1460,7 +1460,7 @@ function SET_UNIT:GetUnitThreatLevels()
|
|||||||
local UnitThreatLevels = {}
|
local UnitThreatLevels = {}
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetSet() ) do
|
for UnitID, UnitData in pairs( self:GetSet() ) do
|
||||||
local ThreatUnit = UnitData -- Unit#UNIT
|
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if ThreatUnit:IsAlive() then
|
if ThreatUnit:IsAlive() then
|
||||||
local UnitThreatLevel, UnitThreatLevelText = ThreatUnit:GetThreatLevel()
|
local UnitThreatLevel, UnitThreatLevelText = ThreatUnit:GetThreatLevel()
|
||||||
local ThreatUnitName = ThreatUnit:GetName()
|
local ThreatUnitName = ThreatUnit:GetName()
|
||||||
@ -1477,14 +1477,14 @@ end
|
|||||||
|
|
||||||
--- Returns if the @{Set} has targets having a radar (of a given type).
|
--- Returns if the @{Set} has targets having a radar (of a given type).
|
||||||
-- @param #SET_UNIT self
|
-- @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
|
-- @return #number The amount of radars in the Set with the given type
|
||||||
function SET_UNIT:HasRadar( RadarType )
|
function SET_UNIT:HasRadar( RadarType )
|
||||||
self:F2( RadarType )
|
self:F2( RadarType )
|
||||||
|
|
||||||
local RadarCount = 0
|
local RadarCount = 0
|
||||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||||
local UnitSensorTest = UnitData -- Unit#UNIT
|
local UnitSensorTest = UnitData -- Wrapper.Unit#UNIT
|
||||||
local HasSensors
|
local HasSensors
|
||||||
if RadarType then
|
if RadarType then
|
||||||
HasSensors = UnitSensorTest:HasSensors( Unit.SensorType.RADAR, RadarType )
|
HasSensors = UnitSensorTest:HasSensors( Unit.SensorType.RADAR, RadarType )
|
||||||
@ -1508,7 +1508,7 @@ function SET_UNIT:HasSEAD()
|
|||||||
|
|
||||||
local SEADCount = 0
|
local SEADCount = 0
|
||||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||||
local UnitSEAD = UnitData -- Unit#UNIT
|
local UnitSEAD = UnitData -- Wrapper.Unit#UNIT
|
||||||
if UnitSEAD:IsAlive() then
|
if UnitSEAD:IsAlive() then
|
||||||
local UnitSEADAttributes = UnitSEAD:GetDesc().attributes
|
local UnitSEADAttributes = UnitSEAD:GetDesc().attributes
|
||||||
|
|
||||||
@ -1532,7 +1532,7 @@ function SET_UNIT:HasGroundUnits()
|
|||||||
|
|
||||||
local GroundUnitCount = 0
|
local GroundUnitCount = 0
|
||||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||||
local UnitTest = UnitData -- Unit#UNIT
|
local UnitTest = UnitData -- Wrapper.Unit#UNIT
|
||||||
if UnitTest:IsGround() then
|
if UnitTest:IsGround() then
|
||||||
GroundUnitCount = GroundUnitCount + 1
|
GroundUnitCount = GroundUnitCount + 1
|
||||||
end
|
end
|
||||||
@ -1549,7 +1549,7 @@ function SET_UNIT:HasFriendlyUnits( FriendlyCoalition )
|
|||||||
|
|
||||||
local FriendlyUnitCount = 0
|
local FriendlyUnitCount = 0
|
||||||
for UnitID, UnitData in pairs( self:GetSet()) do
|
for UnitID, UnitData in pairs( self:GetSet()) do
|
||||||
local UnitTest = UnitData -- Unit#UNIT
|
local UnitTest = UnitData -- Wrapper.Unit#UNIT
|
||||||
if UnitTest:IsFriendly( FriendlyCoalition ) then
|
if UnitTest:IsFriendly( FriendlyCoalition ) then
|
||||||
FriendlyUnitCount = FriendlyUnitCount + 1
|
FriendlyUnitCount = FriendlyUnitCount + 1
|
||||||
end
|
end
|
||||||
@ -1588,7 +1588,7 @@ end
|
|||||||
|
|
||||||
---
|
---
|
||||||
-- @param #SET_UNIT self
|
-- @param #SET_UNIT self
|
||||||
-- @param Unit#UNIT MUnit
|
-- @param Wrapper.Unit#UNIT MUnit
|
||||||
-- @return #SET_UNIT self
|
-- @return #SET_UNIT self
|
||||||
function SET_UNIT:IsIncludeObject( MUnit )
|
function SET_UNIT:IsIncludeObject( MUnit )
|
||||||
self:F2( MUnit )
|
self:F2( MUnit )
|
||||||
@ -1681,7 +1681,7 @@ end
|
|||||||
|
|
||||||
--- SET_CLIENT class
|
--- SET_CLIENT class
|
||||||
-- @type SET_CLIENT
|
-- @type SET_CLIENT
|
||||||
-- @extends Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
SET_CLIENT = {
|
SET_CLIENT = {
|
||||||
ClassName = "SET_CLIENT",
|
ClassName = "SET_CLIENT",
|
||||||
Clients = {},
|
Clients = {},
|
||||||
@ -1723,7 +1723,7 @@ function SET_CLIENT:New()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Add CLIENT(s) to SET_CLIENT.
|
--- 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.
|
-- @param #string AddClientNames A single name or an array of CLIENT names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_CLIENT:AddClientsByName( AddClientNames )
|
function SET_CLIENT:AddClientsByName( AddClientNames )
|
||||||
@ -1738,8 +1738,8 @@ function SET_CLIENT:AddClientsByName( AddClientNames )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Remove CLIENT(s) from SET_CLIENT.
|
--- Remove CLIENT(s) from SET_CLIENT.
|
||||||
-- @param Set#SET_CLIENT self
|
-- @param Core.Set#SET_CLIENT self
|
||||||
-- @param Client#CLIENT RemoveClientNames A single name or an array of CLIENT names.
|
-- @param Wrapper.Client#CLIENT RemoveClientNames A single name or an array of CLIENT names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_CLIENT:RemoveClientsByName( RemoveClientNames )
|
function SET_CLIENT:RemoveClientsByName( RemoveClientNames )
|
||||||
|
|
||||||
@ -1756,7 +1756,7 @@ end
|
|||||||
--- Finds a Client based on the Client Name.
|
--- Finds a Client based on the Client Name.
|
||||||
-- @param #SET_CLIENT self
|
-- @param #SET_CLIENT self
|
||||||
-- @param #string ClientName
|
-- @param #string ClientName
|
||||||
-- @return Client#CLIENT The found Client.
|
-- @return Wrapper.Client#CLIENT The found Client.
|
||||||
function SET_CLIENT:FindClient( ClientName )
|
function SET_CLIENT:FindClient( ClientName )
|
||||||
|
|
||||||
local ClientFound = self.Set[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.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
-- @param #SET_CLIENT self
|
-- @param #SET_CLIENT self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the CLIENT
|
-- @return #string The name of the CLIENT
|
||||||
-- @return #table The CLIENT
|
-- @return #table The CLIENT
|
||||||
function SET_CLIENT:AddInDatabase( Event )
|
function SET_CLIENT:AddInDatabase( Event )
|
||||||
@ -1889,7 +1889,7 @@ end
|
|||||||
--- Handles the Database to check on any event that Object exists in the Database.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||||
-- @param #SET_CLIENT self
|
-- @param #SET_CLIENT self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the CLIENT
|
-- @return #string The name of the CLIENT
|
||||||
-- @return #table The CLIENT
|
-- @return #table The CLIENT
|
||||||
function SET_CLIENT:FindInDatabase( Event )
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_CLIENT self
|
||||||
function SET_CLIENT:ForEachClientInZone( ZoneObject, IteratorFunction, ... )
|
function SET_CLIENT:ForEachClientInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -1920,7 +1920,7 @@ function SET_CLIENT:ForEachClientInZone( ZoneObject, IteratorFunction, ... )
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Client#CLIENT ClientObject
|
-- @param Wrapper.Client#CLIENT ClientObject
|
||||||
function( ZoneObject, ClientObject )
|
function( ZoneObject, ClientObject )
|
||||||
if ClientObject:IsInZone( ZoneObject ) then
|
if ClientObject:IsInZone( ZoneObject ) then
|
||||||
return true
|
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.
|
--- 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 #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.
|
-- @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
|
-- @return #SET_CLIENT self
|
||||||
function SET_CLIENT:ForEachClientNotInZone( ZoneObject, IteratorFunction, ... )
|
function SET_CLIENT:ForEachClientNotInZone( ZoneObject, IteratorFunction, ... )
|
||||||
@ -1942,7 +1942,7 @@ function SET_CLIENT:ForEachClientNotInZone( ZoneObject, IteratorFunction, ... )
|
|||||||
|
|
||||||
self:ForEach( IteratorFunction, arg, self.Set,
|
self:ForEach( IteratorFunction, arg, self.Set,
|
||||||
--- @param Zone#ZONE_BASE ZoneObject
|
--- @param Zone#ZONE_BASE ZoneObject
|
||||||
-- @param Client#CLIENT ClientObject
|
-- @param Wrapper.Client#CLIENT ClientObject
|
||||||
function( ZoneObject, ClientObject )
|
function( ZoneObject, ClientObject )
|
||||||
if ClientObject:IsNotInZone( ZoneObject ) then
|
if ClientObject:IsNotInZone( ZoneObject ) then
|
||||||
return true
|
return true
|
||||||
@ -1956,7 +1956,7 @@ end
|
|||||||
|
|
||||||
---
|
---
|
||||||
-- @param #SET_CLIENT self
|
-- @param #SET_CLIENT self
|
||||||
-- @param Client#CLIENT MClient
|
-- @param Wrapper.Client#CLIENT MClient
|
||||||
-- @return #SET_CLIENT self
|
-- @return #SET_CLIENT self
|
||||||
function SET_CLIENT:IsIncludeObject( MClient )
|
function SET_CLIENT:IsIncludeObject( MClient )
|
||||||
self:F2( MClient )
|
self:F2( MClient )
|
||||||
@ -2038,7 +2038,7 @@ end
|
|||||||
|
|
||||||
--- SET_AIRBASE class
|
--- SET_AIRBASE class
|
||||||
-- @type SET_AIRBASE
|
-- @type SET_AIRBASE
|
||||||
-- @extends Set#SET_BASE
|
-- @extends Core.Set#SET_BASE
|
||||||
SET_AIRBASE = {
|
SET_AIRBASE = {
|
||||||
ClassName = "SET_AIRBASE",
|
ClassName = "SET_AIRBASE",
|
||||||
Airbases = {},
|
Airbases = {},
|
||||||
@ -2074,7 +2074,7 @@ function SET_AIRBASE:New()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Add AIRBASEs to SET_AIRBASE.
|
--- 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.
|
-- @param #string AddAirbaseNames A single name or an array of AIRBASE names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
||||||
@ -2089,8 +2089,8 @@ function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Remove AIRBASEs from SET_AIRBASE.
|
--- Remove AIRBASEs from SET_AIRBASE.
|
||||||
-- @param Set#SET_AIRBASE self
|
-- @param Core.Set#SET_AIRBASE self
|
||||||
-- @param Airbase#AIRBASE RemoveAirbaseNames A single name or an array of AIRBASE names.
|
-- @param Wrapper.Airbase#AIRBASE RemoveAirbaseNames A single name or an array of AIRBASE names.
|
||||||
-- @return self
|
-- @return self
|
||||||
function SET_AIRBASE:RemoveAirbasesByName( RemoveAirbaseNames )
|
function SET_AIRBASE:RemoveAirbasesByName( RemoveAirbaseNames )
|
||||||
|
|
||||||
@ -2107,7 +2107,7 @@ end
|
|||||||
--- Finds a Airbase based on the Airbase Name.
|
--- Finds a Airbase based on the Airbase Name.
|
||||||
-- @param #SET_AIRBASE self
|
-- @param #SET_AIRBASE self
|
||||||
-- @param #string AirbaseName
|
-- @param #string AirbaseName
|
||||||
-- @return Airbase#AIRBASE The found Airbase.
|
-- @return Wrapper.Airbase#AIRBASE The found Airbase.
|
||||||
function SET_AIRBASE:FindAirbase( AirbaseName )
|
function SET_AIRBASE:FindAirbase( AirbaseName )
|
||||||
|
|
||||||
local AirbaseFound = self.Set[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.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||||
-- @param #SET_AIRBASE self
|
-- @param #SET_AIRBASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the AIRBASE
|
-- @return #string The name of the AIRBASE
|
||||||
-- @return #table The AIRBASE
|
-- @return #table The AIRBASE
|
||||||
function SET_AIRBASE:AddInDatabase( Event )
|
function SET_AIRBASE:AddInDatabase( Event )
|
||||||
@ -2181,7 +2181,7 @@ end
|
|||||||
--- Handles the Database to check on any event that Object exists in the Database.
|
--- 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!
|
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||||
-- @param #SET_AIRBASE self
|
-- @param #SET_AIRBASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #string The name of the AIRBASE
|
-- @return #string The name of the AIRBASE
|
||||||
-- @return #table The AIRBASE
|
-- @return #table The AIRBASE
|
||||||
function SET_AIRBASE:FindInDatabase( Event )
|
function SET_AIRBASE:FindInDatabase( Event )
|
||||||
@ -2202,10 +2202,10 @@ function SET_AIRBASE:ForEachAirbase( IteratorFunction, ... )
|
|||||||
return self
|
return self
|
||||||
end
|
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 #SET_AIRBASE self
|
||||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate 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 Airbase#AIRBASE The closest @{Airbase#AIRBASE}.
|
-- @return Wrapper.Airbase#AIRBASE The closest @{Wrapper.Airbase#AIRBASE}.
|
||||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||||
self:F2( PointVec2 )
|
self:F2( PointVec2 )
|
||||||
|
|
||||||
@ -2217,7 +2217,7 @@ end
|
|||||||
|
|
||||||
---
|
---
|
||||||
-- @param #SET_AIRBASE self
|
-- @param #SET_AIRBASE self
|
||||||
-- @param Airbase#AIRBASE MAirbase
|
-- @param Wrapper.Airbase#AIRBASE MAirbase
|
||||||
-- @return #SET_AIRBASE self
|
-- @return #SET_AIRBASE self
|
||||||
function SET_AIRBASE:IsIncludeObject( MAirbase )
|
function SET_AIRBASE:IsIncludeObject( MAirbase )
|
||||||
self:F2( 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:
|
-- There are essentially two core functions that zones accomodate:
|
||||||
--
|
--
|
||||||
-- * Test if an object is within the zone boundaries.
|
-- * 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:
|
-- 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 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.
|
-- * Test if not in the zone.
|
||||||
-- * Distance to the nearest intersecting point of the zone.
|
-- * Distance to the nearest intersecting point of the zone.
|
||||||
-- * Distance to the center 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:
|
-- 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.
|
-- * @{Core.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.
|
-- * @{Core.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.
|
-- * @{Core.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.
|
-- * @{Core.Zone#ZONE_UNIT}: The ZONE_UNIT class defines by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||||
-- * @{Zone#ZONE_GROUP}: The ZONE_GROUP class defines by a zone around a @{Group#GROUP} with a radius.
|
-- * @{Core.Zone#ZONE_GROUP}: The ZONE_GROUP class defines by a zone around a @{Wrapper.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_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.
|
-- 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.
|
-- * @{#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.IsPointVec2InZone}(): Returns if a @{Core.Point#POINT_VEC2} is within the zone.
|
||||||
-- * @{#ZONE_BASE.IsPointVec3InZone}(): Returns if a @{Point#POINT_VEC3} 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:
|
-- ### 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:
|
-- ### 1.4) A zone manages Vectors:
|
||||||
--
|
--
|
||||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{DCSTypes#Vec2} coordinate of the zone.
|
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||||
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{DCSTypes#Vec2} within the zone.
|
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||||
--
|
--
|
||||||
-- ### 1.5) A zone has a bounding square:
|
-- ### 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.
|
-- 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.
|
-- * @{#ZONE_BASE.New}(): Constructor.
|
||||||
--
|
--
|
||||||
@ -75,45 +75,45 @@
|
|||||||
--
|
--
|
||||||
-- ### 2.3) Manage the location of the zone:
|
-- ### 2.3) Manage the location of the zone:
|
||||||
--
|
--
|
||||||
-- * @{#ZONE_BASE.SetVec2}(): Sets the @{DCSTypes#Vec2} of the zone.
|
-- * @{#ZONE_BASE.SetVec2}(): Sets the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||||
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{DCSTypes#Vec2} of the zone.
|
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||||
-- * @{#ZONE_BASE.GetVec3}(): Returns the @{DCSTypes#Vec3} of the zone, taking an additional height parameter.
|
-- * @{#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.
|
-- 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.
|
-- The ZONE_UNIT class defined by a zone around a @{Wrapper.Unit#UNIT} with a radius.
|
||||||
-- 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.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- 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.
|
-- 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 @{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.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- 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.
|
-- 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 @{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.
|
||||||
-- This class is an abstract BASE class for derived classes, and is not meant to be instantiated.
|
-- 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.
|
-- 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 @{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.
|
||||||
--
|
--
|
||||||
-- ====
|
-- ====
|
||||||
--
|
--
|
||||||
@ -145,7 +145,7 @@
|
|||||||
-- @type ZONE_BASE
|
-- @type ZONE_BASE
|
||||||
-- @field #string ZoneName Name of the zone.
|
-- @field #string ZoneName Name of the zone.
|
||||||
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
ZONE_BASE = {
|
ZONE_BASE = {
|
||||||
ClassName = "ZONE_BASE",
|
ClassName = "ZONE_BASE",
|
||||||
ZoneName = "",
|
ZoneName = "",
|
||||||
@ -155,10 +155,10 @@ ZONE_BASE = {
|
|||||||
|
|
||||||
--- The ZONE_BASE.BoundingSquare
|
--- The ZONE_BASE.BoundingSquare
|
||||||
-- @type ZONE_BASE.BoundingSquare
|
-- @type ZONE_BASE.BoundingSquare
|
||||||
-- @field DCSTypes#Distance x1 The lower x coordinate (left down)
|
-- @field Dcs.DCSTypes#Distance x1 The lower x coordinate (left down)
|
||||||
-- @field DCSTypes#Distance y1 The lower y coordinate (left down)
|
-- @field Dcs.DCSTypes#Distance y1 The lower y coordinate (left down)
|
||||||
-- @field DCSTypes#Distance x2 The higher x coordinate (right up)
|
-- @field Dcs.DCSTypes#Distance x2 The higher x coordinate (right up)
|
||||||
-- @field DCSTypes#Distance y2 The higher y coordinate (right up)
|
-- @field Dcs.DCSTypes#Distance y2 The higher y coordinate (right up)
|
||||||
|
|
||||||
|
|
||||||
--- ZONE_BASE constructor
|
--- ZONE_BASE constructor
|
||||||
@ -184,7 +184,7 @@ function ZONE_BASE:GetName()
|
|||||||
end
|
end
|
||||||
--- Returns if a location is within the zone.
|
--- Returns if a location is within the zone.
|
||||||
-- @param #ZONE_BASE self
|
-- @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.
|
-- @return #boolean true if the location is within the zone.
|
||||||
function ZONE_BASE:IsPointVec2InZone( Vec2 )
|
function ZONE_BASE:IsPointVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
self:F2( Vec2 )
|
||||||
@ -194,7 +194,7 @@ end
|
|||||||
|
|
||||||
--- Returns if a point is within the zone.
|
--- Returns if a point is within the zone.
|
||||||
-- @param #ZONE_BASE self
|
-- @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.
|
-- @return #boolean true if the point is within the zone.
|
||||||
function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
||||||
self:F2( Vec3 )
|
self:F2( Vec3 )
|
||||||
@ -204,7 +204,7 @@ function ZONE_BASE:IsPointVec3InZone( Vec3 )
|
|||||||
return InZone
|
return InZone
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec2} coordinate of the zone.
|
--- Returns the @{Dcs.DCSTypes#Vec2} coordinate of the zone.
|
||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @return #nil.
|
-- @return #nil.
|
||||||
function ZONE_BASE:GetVec2()
|
function ZONE_BASE:GetVec2()
|
||||||
@ -212,9 +212,9 @@ function ZONE_BASE:GetVec2()
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @return DCSTypes#Vec2 The Vec2 coordinates.
|
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinates.
|
||||||
function ZONE_BASE:GetRandomVec2()
|
function ZONE_BASE:GetRandomVec2()
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@ -273,9 +273,9 @@ end
|
|||||||
|
|
||||||
--- The ZONE_RADIUS class, defined by a zone name, a location and a radius.
|
--- The ZONE_RADIUS class, defined by a zone name, a location and a radius.
|
||||||
-- @type ZONE_RADIUS
|
-- @type ZONE_RADIUS
|
||||||
-- @field DCSTypes#Vec2 Vec2 The current location of the zone.
|
-- @field Dcs.DCSTypes#Vec2 Vec2 The current location of the zone.
|
||||||
-- @field DCSTypes#Distance Radius The radius of the zone.
|
-- @field Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @extends Zone#ZONE_BASE
|
-- @extends Core.Zone#ZONE_BASE
|
||||||
ZONE_RADIUS = {
|
ZONE_RADIUS = {
|
||||||
ClassName="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.
|
--- Constructor of @{#ZONE_RADIUS}, taking the zone name, the zone location and a radius.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @param #string ZoneName Name of the zone.
|
-- @param #string ZoneName Name of the zone.
|
||||||
-- @param DCSTypes#Vec2 Vec2 The location of the zone.
|
-- @param Dcs.DCSTypes#Vec2 Vec2 The location of the zone.
|
||||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @return #ZONE_RADIUS self
|
-- @return #ZONE_RADIUS self
|
||||||
function ZONE_RADIUS:New( ZoneName, Vec2, Radius )
|
function ZONE_RADIUS:New( ZoneName, Vec2, Radius )
|
||||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
||||||
@ -325,9 +325,9 @@ end
|
|||||||
|
|
||||||
--- Flares the zone boundaries in a color.
|
--- Flares the zone boundaries in a color.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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 #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
|
-- @return #ZONE_RADIUS self
|
||||||
function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth )
|
function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth )
|
||||||
self:F2( { FlareColor, Azimuth } )
|
self:F2( { FlareColor, Azimuth } )
|
||||||
@ -352,7 +352,7 @@ end
|
|||||||
|
|
||||||
--- Returns the radius of the zone.
|
--- Returns the radius of the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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()
|
function ZONE_RADIUS:GetRadius()
|
||||||
self:F2( self.ZoneName )
|
self:F2( self.ZoneName )
|
||||||
|
|
||||||
@ -363,8 +363,8 @@ end
|
|||||||
|
|
||||||
--- Sets the radius of the zone.
|
--- Sets the radius of the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @return DCSTypes#Distance The radius of the zone.
|
-- @return Dcs.DCSTypes#Distance The radius of the zone.
|
||||||
function ZONE_RADIUS:SetRadius( Radius )
|
function ZONE_RADIUS:SetRadius( Radius )
|
||||||
self:F2( self.ZoneName )
|
self:F2( self.ZoneName )
|
||||||
|
|
||||||
@ -374,9 +374,9 @@ function ZONE_RADIUS:SetRadius( Radius )
|
|||||||
return self.Radius
|
return self.Radius
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec2} of the zone.
|
--- Returns the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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()
|
function ZONE_RADIUS:GetVec2()
|
||||||
self:F2( self.ZoneName )
|
self:F2( self.ZoneName )
|
||||||
|
|
||||||
@ -385,10 +385,10 @@ function ZONE_RADIUS:GetVec2()
|
|||||||
return self.Vec2
|
return self.Vec2
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Sets the @{DCSTypes#Vec2} of the zone.
|
--- Sets the @{Dcs.DCSTypes#Vec2} of the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @param DCSTypes#Vec2 Vec2 The new location of the zone.
|
-- @param Dcs.DCSTypes#Vec2 Vec2 The new location of the zone.
|
||||||
-- @return DCSTypes#Vec2 The new location of the zone.
|
-- @return Dcs.DCSTypes#Vec2 The new location of the zone.
|
||||||
function ZONE_RADIUS:SetVec2( Vec2 )
|
function ZONE_RADIUS:SetVec2( Vec2 )
|
||||||
self:F2( self.ZoneName )
|
self:F2( self.ZoneName )
|
||||||
|
|
||||||
@ -399,10 +399,10 @@ function ZONE_RADIUS:SetVec2( Vec2 )
|
|||||||
return self.Vec2
|
return self.Vec2
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_RADIUS.
|
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_RADIUS.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @param DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param Dcs.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.
|
-- @return Dcs.DCSTypes#Vec3 The point of the zone.
|
||||||
function ZONE_RADIUS:GetVec3( Height )
|
function ZONE_RADIUS:GetVec3( Height )
|
||||||
self:F2( { self.ZoneName, Height } )
|
self:F2( { self.ZoneName, Height } )
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ end
|
|||||||
|
|
||||||
--- Returns if a location is within the zone.
|
--- Returns if a location is within the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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.
|
-- @return #boolean true if the location is within the zone.
|
||||||
function ZONE_RADIUS:IsPointVec2InZone( Vec2 )
|
function ZONE_RADIUS:IsPointVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
self:F2( Vec2 )
|
||||||
@ -437,7 +437,7 @@ end
|
|||||||
|
|
||||||
--- Returns if a point is within the zone.
|
--- Returns if a point is within the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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.
|
-- @return #boolean true if the point is within the zone.
|
||||||
function ZONE_RADIUS:IsPointVec3InZone( Vec3 )
|
function ZONE_RADIUS:IsPointVec3InZone( Vec3 )
|
||||||
self:F2( Vec3 )
|
self:F2( Vec3 )
|
||||||
@ -449,7 +449,7 @@ end
|
|||||||
|
|
||||||
--- Returns a random location within the zone.
|
--- Returns a random location within the zone.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @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()
|
function ZONE_RADIUS:GetRandomVec2()
|
||||||
self:F( self.ZoneName )
|
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.
|
--- 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
|
-- @type ZONE
|
||||||
-- @extends Zone#ZONE_RADIUS
|
-- @extends Core.Zone#ZONE_RADIUS
|
||||||
ZONE = {
|
ZONE = {
|
||||||
ClassName="ZONE",
|
ClassName="ZONE",
|
||||||
}
|
}
|
||||||
@ -497,10 +497,10 @@ function ZONE:New( ZoneName )
|
|||||||
end
|
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
|
-- @type ZONE_UNIT
|
||||||
-- @field Unit#UNIT ZoneUNIT
|
-- @field Wrapper.Unit#UNIT ZoneUNIT
|
||||||
-- @extends Zone#ZONE_RADIUS
|
-- @extends Core.Zone#ZONE_RADIUS
|
||||||
ZONE_UNIT = {
|
ZONE_UNIT = {
|
||||||
ClassName="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.
|
--- Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.
|
||||||
-- @param #ZONE_UNIT self
|
-- @param #ZONE_UNIT self
|
||||||
-- @param #string ZoneName Name of the zone.
|
-- @param #string ZoneName Name of the zone.
|
||||||
-- @param Unit#UNIT ZoneUNIT The unit as the center of the zone.
|
-- @param Wrapper.Unit#UNIT ZoneUNIT The unit as the center of the zone.
|
||||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @return #ZONE_UNIT self
|
-- @return #ZONE_UNIT self
|
||||||
function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
|
function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
|
||||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneUNIT:GetVec2(), 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
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Returns the current location of the @{Unit#UNIT}.
|
--- Returns the current location of the @{Wrapper.Unit#UNIT}.
|
||||||
-- @param #ZONE_UNIT self
|
-- @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()
|
function ZONE_UNIT:GetVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ end
|
|||||||
|
|
||||||
--- Returns a random location within the zone.
|
--- Returns a random location within the zone.
|
||||||
-- @param #ZONE_UNIT self
|
-- @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()
|
function ZONE_UNIT:GetRandomVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
@ -563,10 +563,10 @@ function ZONE_UNIT:GetRandomVec2()
|
|||||||
return RandomVec2
|
return RandomVec2
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec3} of the ZONE_UNIT.
|
--- Returns the @{Dcs.DCSTypes#Vec3} of the ZONE_UNIT.
|
||||||
-- @param #ZONE_UNIT self
|
-- @param #ZONE_UNIT self
|
||||||
-- @param DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
|
-- @param Dcs.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.
|
-- @return Dcs.DCSTypes#Vec3 The point of the zone.
|
||||||
function ZONE_UNIT:GetVec3( Height )
|
function ZONE_UNIT:GetVec3( Height )
|
||||||
self:F2( self.ZoneName )
|
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.
|
--- 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
|
-- @type ZONE_GROUP
|
||||||
-- @field Group#GROUP ZoneGROUP
|
-- @field Wrapper.Group#GROUP ZoneGROUP
|
||||||
-- @extends Zone#ZONE_RADIUS
|
-- @extends Core.Zone#ZONE_RADIUS
|
||||||
ZONE_GROUP = {
|
ZONE_GROUP = {
|
||||||
ClassName="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 #ZONE_GROUP self
|
||||||
-- @param #string ZoneName Name of the zone.
|
-- @param #string ZoneName Name of the zone.
|
||||||
-- @param Group#GROUP ZoneGROUP The @{Group} as the center of the zone.
|
-- @param Wrapper.Group#GROUP ZoneGROUP The @{Group} as the center of the zone.
|
||||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @return #ZONE_GROUP self
|
-- @return #ZONE_GROUP self
|
||||||
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
||||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), 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}.
|
--- Returns the current location of the @{Group}.
|
||||||
-- @param #ZONE_GROUP self
|
-- @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()
|
function ZONE_GROUP:GetVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
@ -620,7 +620,7 @@ end
|
|||||||
|
|
||||||
--- Returns a random location within the zone of the @{Group}.
|
--- Returns a random location within the zone of the @{Group}.
|
||||||
-- @param #ZONE_GROUP self
|
-- @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()
|
function ZONE_GROUP:GetRandomVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
@ -640,23 +640,23 @@ end
|
|||||||
|
|
||||||
-- Polygons
|
-- 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
|
-- @type ZONE_POLYGON_BASE
|
||||||
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{DCSTypes#Vec2}.
|
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{Dcs.DCSTypes#Vec2}.
|
||||||
-- @extends Zone#ZONE_BASE
|
-- @extends Core.Zone#ZONE_BASE
|
||||||
ZONE_POLYGON_BASE = {
|
ZONE_POLYGON_BASE = {
|
||||||
ClassName="ZONE_POLYGON_BASE",
|
ClassName="ZONE_POLYGON_BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- A points array.
|
--- A points array.
|
||||||
-- @type ZONE_POLYGON_BASE.ListVec2
|
-- @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.
|
--- Constructor to create a ZONE_POLYGON_BASE instance, taking the zone name and an array of @{Dcs.DCSTypes#Vec2}, forming a polygon.
|
||||||
-- The @{Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected.
|
-- The @{Wrapper.Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected.
|
||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @param #string ZoneName Name of the zone.
|
-- @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
|
-- @return #ZONE_POLYGON_BASE self
|
||||||
function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
|
function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
|
||||||
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
|
||||||
@ -725,7 +725,7 @@ end
|
|||||||
--- Returns if a location is within the zone.
|
--- 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
|
-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @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.
|
-- @return #boolean true if the location is within the zone.
|
||||||
function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
||||||
self:F2( Vec2 )
|
self:F2( Vec2 )
|
||||||
@ -753,9 +753,9 @@ function ZONE_POLYGON_BASE:IsPointVec2InZone( Vec2 )
|
|||||||
return InPolygon
|
return InPolygon
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
--- Define a random @{Dcs.DCSTypes#Vec2} within the zone.
|
||||||
-- @param #ZONE_POLYGON_BASE self
|
-- @param #ZONE_POLYGON_BASE self
|
||||||
-- @return DCSTypes#Vec2 The Vec2 coordinate.
|
-- @return Dcs.DCSTypes#Vec2 The Vec2 coordinate.
|
||||||
function ZONE_POLYGON_BASE:GetRandomVec2()
|
function ZONE_POLYGON_BASE:GetRandomVec2()
|
||||||
self:F2()
|
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
|
-- @type ZONE_POLYGON
|
||||||
-- @extends Zone#ZONE_POLYGON_BASE
|
-- @extends Core.Zone#ZONE_POLYGON_BASE
|
||||||
ZONE_POLYGON = {
|
ZONE_POLYGON = {
|
||||||
ClassName="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.
|
--- 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 @{Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.
|
-- 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 #ZONE_POLYGON self
|
||||||
-- @param #string ZoneName Name of the zone.
|
-- @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
|
-- @return #ZONE_POLYGON self
|
||||||
function ZONE_POLYGON:New( ZoneName, ZoneGroup )
|
function ZONE_POLYGON:New( ZoneName, ZoneGroup )
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
--- Represents airbases: airdromes, helipads and ships with flying decks or landing pads.
|
--- Represents airbases: airdromes, helipads and ships with flying decks or landing pads.
|
||||||
-- @type Airbase
|
-- @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.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.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.
|
-- @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.
|
--- Returns Unit that is corresponded to the airbase. Works only for ships.
|
||||||
-- @function [parent=#Airbase] getUnit
|
-- @function [parent=#Airbase] getUnit
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return Unit#Unit
|
-- @return Wrapper.Unit#Unit
|
||||||
|
|
||||||
--- Returns identifier of the airbase.
|
--- Returns identifier of the airbase.
|
||||||
-- @function [parent=#Airbase] getID
|
-- @function [parent=#Airbase] getID
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- @module DCSCoalitionObject
|
-- @module DCSCoalitionObject
|
||||||
|
|
||||||
--- @type CoalitionObject
|
--- @type CoalitionObject
|
||||||
-- @extends DCSObject#Object
|
-- @extends Dcs.DCSWrapper.Object#Object
|
||||||
|
|
||||||
--- @type coalition
|
--- @type coalition
|
||||||
-- @field #coalition.side side
|
-- @field #coalition.side side
|
||||||
@ -17,7 +17,7 @@ coalition = {} --#coalition
|
|||||||
--- Returns coalition of the object.
|
--- Returns coalition of the object.
|
||||||
-- @function [parent=#CoalitionObject] getCoalition
|
-- @function [parent=#CoalitionObject] getCoalition
|
||||||
-- @param #CoalitionObject self
|
-- @param #CoalitionObject self
|
||||||
-- @return DCSTypes#coalition.side
|
-- @return Dcs.DCSTypes#coalition.side
|
||||||
|
|
||||||
--- Returns object country.
|
--- Returns object country.
|
||||||
-- @function [parent=#CoalitionObject] getCountry
|
-- @function [parent=#CoalitionObject] getCountry
|
||||||
|
|||||||
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
--- Detected target.
|
--- Detected target.
|
||||||
-- @type DetectedTarget
|
-- @type DetectedTarget
|
||||||
-- @field Object#Object object The target
|
-- @field Wrapper.Object#Object object The target
|
||||||
-- @field #boolean visible The target is visible
|
-- @field #boolean visible The target is visible
|
||||||
-- @field #boolean type The target type is known
|
-- @field #boolean type The target type is known
|
||||||
-- @field #boolean distance Distance to the target 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.
|
--- 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
|
-- @function [parent=#Controller] isTargetDetected
|
||||||
-- @param self
|
-- @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
|
-- @param #Controller.Detection detection Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
|
||||||
-- @return #boolean detected True if the target is detected.
|
-- @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.
|
-- @return #boolean visible Has effect only if detected is true. True if the target is visible now.
|
||||||
@ -107,7 +107,7 @@
|
|||||||
--- Know a target.
|
--- Know a target.
|
||||||
-- @function [parent=#Controller] knowTarget
|
-- @function [parent=#Controller] knowTarget
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param Object#Object object The target.
|
-- @param Wrapper.Object#Object object The target.
|
||||||
-- @param #boolean type Target type is known.
|
-- @param #boolean type Target type is known.
|
||||||
-- @param #boolean distance Distance to target is known.
|
-- @param #boolean distance Distance to target is known.
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
--- Returns the coalition of the group.
|
--- Returns the coalition of the group.
|
||||||
-- @function [parent=#Group] getCoalition
|
-- @function [parent=#Group] getCoalition
|
||||||
-- @param #Group self
|
-- @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.
|
--- Returns the group's name. This is the same name assigned to the group in Mission Editor.
|
||||||
-- @function [parent=#Group] getName
|
-- @function [parent=#Group] getName
|
||||||
@ -57,7 +57,7 @@
|
|||||||
-- @function [parent=#Group] getUnit
|
-- @function [parent=#Group] getUnit
|
||||||
-- @param #Group self
|
-- @param #Group self
|
||||||
-- @param #number unitNumber
|
-- @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.
|
--- 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
|
-- @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.
|
--- Returns array of the units present in the group now. Destroyed units will not be enlisted at all.
|
||||||
-- @function [parent=#Group] getUnits
|
-- @function [parent=#Group] getUnits
|
||||||
-- @param #Group self
|
-- @param #Group self
|
||||||
-- @return #list<DCSUnit#Unit> array of Units
|
-- @return #list<Dcs.DCSWrapper.Unit#Unit> array of Units
|
||||||
|
|
||||||
--- Returns controller of the group.
|
--- Returns controller of the group.
|
||||||
-- @function [parent=#Group] getController
|
-- @function [parent=#Group] getController
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- @module StaticObject
|
-- @module StaticObject
|
||||||
-- @extends CoalitionObject#CoalitionObject
|
-- @extends CoalitionWrapper.Object#CoalitionObject
|
||||||
|
|
||||||
--- Represents static object added in the Mission Editor.
|
--- Represents static object added in the Mission Editor.
|
||||||
-- @type StaticObject
|
-- @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.
|
--- 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
|
-- @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.
|
--- Returns static object by its name. If no static object found nil will be returned.
|
||||||
-- @function [parent=#StaticObject] getByName
|
-- @function [parent=#StaticObject] getByName
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- @module DCSUnit
|
-- @module DCSUnit
|
||||||
|
|
||||||
--- @type Unit
|
--- @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 ID Identifier of an unit. It assigned to an unit by the Mission Editor automatically.
|
||||||
-- @field #Unit.Category Category
|
-- @field #Unit.Category Category
|
||||||
-- @field #Unit.RefuelingSystem RefuelingSystem
|
-- @field #Unit.RefuelingSystem RefuelingSystem
|
||||||
@ -57,14 +57,14 @@
|
|||||||
|
|
||||||
--- A unit descriptor.
|
--- A unit descriptor.
|
||||||
-- @type Unit.Desc
|
-- @type Unit.Desc
|
||||||
-- @extends Object#Object.Desc
|
-- @extends Wrapper.Object#Object.Desc
|
||||||
-- @field #Unit.Category category Unit Category
|
-- @field #Unit.Category category Unit Category
|
||||||
-- @field #Mass massEmpty mass of empty unit
|
-- @field #Mass massEmpty mass of empty unit
|
||||||
-- @field #number speedMax istance / Time, --maximal velocity
|
-- @field #number speedMax istance / Time, --maximal velocity
|
||||||
|
|
||||||
--- An aircraft descriptor.
|
--- An aircraft descriptor.
|
||||||
-- @type Unit.DescAircraft
|
-- @type Unit.DescAircraft
|
||||||
-- @extends Unit#Unit.Desc
|
-- @extends Wrapper.Unit#Unit.Desc
|
||||||
-- @field #Mass fuelMassMax maximal inner fuel mass
|
-- @field #Mass fuelMassMax maximal inner fuel mass
|
||||||
-- @field #Distance range Operational range
|
-- @field #Distance range Operational range
|
||||||
-- @field #Distance Hmax Ceiling
|
-- @field #Distance Hmax Ceiling
|
||||||
@ -75,18 +75,18 @@
|
|||||||
|
|
||||||
--- An airplane descriptor.
|
--- An airplane descriptor.
|
||||||
-- @type Unit.DescAirplane
|
-- @type Unit.DescAirplane
|
||||||
-- @extends Unit#Unit.DescAircraft
|
-- @extends Wrapper.Unit#Unit.DescAircraft
|
||||||
-- @field #number speedMax0 Distance / Time maximal TAS at ground level
|
-- @field #number speedMax0 Distance / Time maximal TAS at ground level
|
||||||
-- @field #number speedMax10K Distance / Time maximal TAS at altitude of 10 km
|
-- @field #number speedMax10K Distance / Time maximal TAS at altitude of 10 km
|
||||||
|
|
||||||
--- A helicopter descriptor.
|
--- A helicopter descriptor.
|
||||||
-- @type Unit.DescHelicopter
|
-- @type Unit.DescHelicopter
|
||||||
-- @extends Unit#Unit.DescAircraft
|
-- @extends Wrapper.Unit#Unit.DescAircraft
|
||||||
-- @field #Distance HmaxStat static ceiling
|
-- @field #Distance HmaxStat static ceiling
|
||||||
|
|
||||||
--- A vehicle descriptor.
|
--- A vehicle descriptor.
|
||||||
-- @type Unit.DescVehicle
|
-- @type Unit.DescVehicle
|
||||||
-- @extends Unit#Unit.Desc
|
-- @extends Wrapper.Unit#Unit.Desc
|
||||||
-- @field #Angle maxSlopeAngle maximal slope angle
|
-- @field #Angle maxSlopeAngle maximal slope angle
|
||||||
-- @field #boolean riverCrossing can the vehicle cross a rivers
|
-- @field #boolean riverCrossing can the vehicle cross a rivers
|
||||||
|
|
||||||
@ -106,12 +106,12 @@
|
|||||||
|
|
||||||
--- An optic sensor.
|
--- An optic sensor.
|
||||||
-- @type Unit.Optic
|
-- @type Unit.Optic
|
||||||
-- @extends Unit#Unit.Sensor
|
-- @extends Wrapper.Unit#Unit.Sensor
|
||||||
-- @field #Unit.OpticType opticType
|
-- @field #Unit.OpticType opticType
|
||||||
|
|
||||||
--- A radar.
|
--- A radar.
|
||||||
-- @type Unit.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 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 #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
|
-- @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
|
-- @field #Distance tailOn
|
||||||
|
|
||||||
--- An IRST.
|
--- An IRST.
|
||||||
-- @type Unit#Unit.IRST
|
-- @type Wrapper.Unit#Unit.IRST
|
||||||
-- @extends Unit.Sensor
|
-- @extends Unit.Sensor
|
||||||
-- @field #Distance detectionDistanceIdle detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle
|
-- @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
|
-- @field #Distance detectionDistanceMaximal ..., engines are in maximal mode
|
||||||
@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
--- An RWR.
|
--- An RWR.
|
||||||
-- @type Unit.RWR
|
-- @type Unit.RWR
|
||||||
-- @extends Unit#Unit.Sensor
|
-- @extends Wrapper.Unit#Unit.Sensor
|
||||||
|
|
||||||
--- table that stores all unit sensors.
|
--- table that stores all unit sensors.
|
||||||
-- TODO @type Sensors
|
-- TODO @type Sensors
|
||||||
@ -178,7 +178,7 @@
|
|||||||
--- Returns the unit's group if it exist and nil otherwise
|
--- Returns the unit's group if it exist and nil otherwise
|
||||||
-- @function [parent=#Unit] getGroup
|
-- @function [parent=#Unit] getGroup
|
||||||
-- @param #Unit self
|
-- @param #Unit self
|
||||||
-- @return DCSGroup#Group
|
-- @return Dcs.DCSWrapper.Group#Group
|
||||||
|
|
||||||
--- Returns the unit's callsign - the localized string.
|
--- Returns the unit's callsign - the localized string.
|
||||||
-- @function [parent=#Unit] getCallsign
|
-- @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.
|
-- 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
|
-- @function [parent=#Unit] getRadar
|
||||||
-- @param #Unit self
|
-- @param #Unit self
|
||||||
-- @return #boolean, Object#Object
|
-- @return #boolean, Wrapper.Object#Object
|
||||||
|
|
||||||
--- Returns unit descriptor. Descriptor type depends on unit category.
|
--- Returns unit descriptor. Descriptor type depends on unit category.
|
||||||
-- @function [parent=#Unit] getDesc
|
-- @function [parent=#Unit] getDesc
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
--- Returns altitude MSL of the point.
|
--- Returns altitude MSL of the point.
|
||||||
-- @function [parent=#land] getHeight
|
-- @function [parent=#land] getHeight
|
||||||
-- @param #Vec2 point point on the ground.
|
-- @param #Vec2 point point on the ground.
|
||||||
-- @return DCSTypes#Distance
|
-- @return Dcs.DCSTypes#Distance
|
||||||
|
|
||||||
--- returns surface type at the given point.
|
--- returns surface type at the given point.
|
||||||
-- @function [parent=#land] getSurfaceType
|
-- @function [parent=#land] getSurfaceType
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
-- The state transition method needs to start with the name **OnAfter + the name of the state**.
|
-- 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.
|
-- 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_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.
|
-- 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
|
--- PROCESS_ACCOUNT class
|
||||||
-- @type PROCESS_ACCOUNT
|
-- @type PROCESS_ACCOUNT
|
||||||
-- @field Set#SET_UNIT TargetSetUnit
|
-- @field Set#SET_UNIT TargetSetUnit
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||||
PROCESS_ACCOUNT = {
|
PROCESS_ACCOUNT = {
|
||||||
ClassName = "PROCESS_ACCOUNT",
|
ClassName = "PROCESS_ACCOUNT",
|
||||||
TargetSetUnit = nil,
|
TargetSetUnit = nil,
|
||||||
@ -89,7 +89,7 @@ do -- PROCESS_ACCOUNT
|
|||||||
function PROCESS_ACCOUNT:New()
|
function PROCESS_ACCOUNT:New()
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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( "Assigned", "Start", "Waiting")
|
||||||
self:AddTransition( "*", "Wait", "Waiting")
|
self:AddTransition( "*", "Wait", "Waiting")
|
||||||
@ -111,7 +111,7 @@ do -- PROCESS_ACCOUNT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ACCOUNT self
|
-- @param #PROCESS_ACCOUNT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -125,7 +125,7 @@ do -- PROCESS_ACCOUNT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ACCOUNT self
|
-- @param #PROCESS_ACCOUNT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -143,7 +143,7 @@ do -- PROCESS_ACCOUNT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ACCOUNT self
|
-- @param #PROCESS_ACCOUNT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -199,7 +199,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -213,7 +213,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -233,7 +233,7 @@ do -- PROCESS_ACCOUNT_DEADS
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @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.
|
-- 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.
|
-- 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.
|
-- 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
|
--- PROCESS_ASSIGN class
|
||||||
-- @type PROCESS_ASSIGN
|
-- @type PROCESS_ASSIGN
|
||||||
-- @field Tasking.Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Zone#ZONE_BASE TargetZone
|
-- @field Zone#ZONE_BASE TargetZone
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||||
PROCESS_ASSIGN = {
|
PROCESS_ASSIGN = {
|
||||||
ClassName = "PROCESS_ASSIGN",
|
ClassName = "PROCESS_ASSIGN",
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ do -- PROCESS_ASSIGN
|
|||||||
function PROCESS_ASSIGN:New()
|
function PROCESS_ASSIGN:New()
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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( "UnAssigned", "Start", "Waiting" )
|
||||||
self:AddTransition( "Waiting", "Assign", "Assigned" )
|
self:AddTransition( "Waiting", "Assign", "Assigned" )
|
||||||
@ -123,8 +123,8 @@ do -- PROCESS_ASSIGN_ACCEPT
|
|||||||
|
|
||||||
--- PROCESS_ASSIGN_ACCEPT class
|
--- PROCESS_ASSIGN_ACCEPT class
|
||||||
-- @type PROCESS_ASSIGN_ACCEPT
|
-- @type PROCESS_ASSIGN_ACCEPT
|
||||||
-- @field Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Zone#ZONE_BASE TargetZone
|
-- @field Zone#ZONE_BASE TargetZone
|
||||||
-- @extends Fsm.Process#PROCESS
|
-- @extends Fsm.Process#PROCESS
|
||||||
PROCESS_ASSIGN_ACCEPT = {
|
PROCESS_ASSIGN_ACCEPT = {
|
||||||
@ -183,8 +183,8 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
|||||||
|
|
||||||
--- PROCESS_ASSIGN_MENU_ACCEPT class
|
--- PROCESS_ASSIGN_MENU_ACCEPT class
|
||||||
-- @type PROCESS_ASSIGN_MENU_ACCEPT
|
-- @type PROCESS_ASSIGN_MENU_ACCEPT
|
||||||
-- @field Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Zone#ZONE_BASE TargetZone
|
-- @field Zone#ZONE_BASE TargetZone
|
||||||
-- @extends #PROCESS_ASSIGN
|
-- @extends #PROCESS_ASSIGN
|
||||||
PROCESS_ASSIGN_MENU_ACCEPT = {
|
PROCESS_ASSIGN_MENU_ACCEPT = {
|
||||||
@ -222,7 +222,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -256,7 +256,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -268,7 +268,7 @@ do -- PROCESS_ASSIGN_MENU_ACCEPT
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
-- @param #PROCESS_ASSIGN_MENU_ACCEPT self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -12,7 +12,7 @@
|
|||||||
--
|
--
|
||||||
-- * CARGO_GROUPED, represented by a Group of CARGO_UNITs.
|
-- * 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.
|
-- 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.
|
-- 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.
|
-- The cargo must be in the **UnLoaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] Board
|
-- @function [parent=#CARGO_BASE] Board
|
||||||
-- @param #CARGO_BASE self
|
-- @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.
|
--- 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.
|
-- The cargo must be in the **UnLoaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] __Board
|
-- @function [parent=#CARGO_BASE] __Board
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
-- @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
|
-- UnBoard
|
||||||
@ -90,14 +90,14 @@
|
|||||||
-- The cargo must be in the **Loaded** state.
|
-- The cargo must be in the **Loaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] UnBoard
|
-- @function [parent=#CARGO_BASE] UnBoard
|
||||||
-- @param #CARGO_BASE self
|
-- @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.
|
--- 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.
|
-- The cargo must be in the **Loaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] __UnBoard
|
-- @function [parent=#CARGO_BASE] __UnBoard
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
-- @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
|
-- Load
|
||||||
@ -106,14 +106,14 @@
|
|||||||
-- The cargo must be in the **UnLoaded** state.
|
-- The cargo must be in the **UnLoaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] Load
|
-- @function [parent=#CARGO_BASE] Load
|
||||||
-- @param #CARGO_BASE self
|
-- @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.
|
--- 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.
|
-- The cargo must be in the **UnLoaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] __Load
|
-- @function [parent=#CARGO_BASE] __Load
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
-- @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
|
-- UnLoad
|
||||||
@ -122,14 +122,14 @@
|
|||||||
-- The cargo must be in the **Loaded** state.
|
-- The cargo must be in the **Loaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] UnLoad
|
-- @function [parent=#CARGO_BASE] UnLoad
|
||||||
-- @param #CARGO_BASE self
|
-- @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.
|
--- 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.
|
-- The cargo must be in the **Loaded** state.
|
||||||
-- @function [parent=#CARGO_BASE] __UnLoad
|
-- @function [parent=#CARGO_BASE] __UnLoad
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
-- @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
|
-- State Transition Functions
|
||||||
|
|
||||||
@ -137,62 +137,62 @@
|
|||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnBeforeUnLoaded
|
--- @function [parent=#CARGO_BASE] OnBeforeUnLoaded
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnAfterUnLoaded
|
--- @function [parent=#CARGO_BASE] OnAfterUnLoaded
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
|
|
||||||
-- Loaded
|
-- Loaded
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnBeforeLoaded
|
--- @function [parent=#CARGO_BASE] OnBeforeLoaded
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnAfterLoaded
|
--- @function [parent=#CARGO_BASE] OnAfterLoaded
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
|
|
||||||
-- Boarding
|
-- Boarding
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnBeforeBoarding
|
--- @function [parent=#CARGO_BASE] OnBeforeBoarding
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnAfterBoarding
|
--- @function [parent=#CARGO_BASE] OnAfterBoarding
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
|
|
||||||
-- UnBoarding
|
-- UnBoarding
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnBeforeUnBoarding
|
--- @function [parent=#CARGO_BASE] OnBeforeUnBoarding
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
--- @function [parent=#CARGO_BASE] OnAfterUnBoarding
|
--- @function [parent=#CARGO_BASE] OnAfterUnBoarding
|
||||||
-- @param #CARGO_BASE self
|
-- @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 = {}
|
CARGOS = {}
|
||||||
|
|
||||||
do -- CARGO_BASE
|
do -- CARGO_BASE
|
||||||
|
|
||||||
--- @type 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 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 #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 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 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 #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 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 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 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 Slingloadable This flag defines if the cargo can be slingloaded.
|
||||||
-- @field #boolean Moveable This flag defines if the cargo is moveable.
|
-- @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.
|
-- @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
|
--- @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.
|
--- 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 } )
|
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
|
||||||
|
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ end
|
|||||||
|
|
||||||
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
||||||
-- @param #CARGO_BASE self
|
-- @param #CARGO_BASE self
|
||||||
-- @param Point#POINT_VEC2 PointVec2
|
-- @param Core.Point#POINT_VEC2 PointVec2
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
function CARGO_BASE:IsNear( PointVec2 )
|
function CARGO_BASE:IsNear( PointVec2 )
|
||||||
self:F( { PointVec2 } )
|
self:F( { PointVec2 } )
|
||||||
@ -301,7 +301,7 @@ do -- CARGO_REPRESENTABLE
|
|||||||
|
|
||||||
--- CARGO_REPRESENTABLE Constructor.
|
--- CARGO_REPRESENTABLE Constructor.
|
||||||
-- @param #CARGO_REPRESENTABLE self
|
-- @param #CARGO_REPRESENTABLE self
|
||||||
-- @param Controllable#Controllable CargoObject
|
-- @param Wrapper.Controllable#Controllable CargoObject
|
||||||
-- @param #string Type
|
-- @param #string Type
|
||||||
-- @param #string Name
|
-- @param #string Name
|
||||||
-- @param #number Weight
|
-- @param #number Weight
|
||||||
@ -320,7 +320,7 @@ end
|
|||||||
|
|
||||||
--- Route a cargo unit to a PointVec2.
|
--- Route a cargo unit to a PointVec2.
|
||||||
-- @param #CARGO_REPRESENTABLE self
|
-- @param #CARGO_REPRESENTABLE self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @return #CARGO_REPRESENTABLE
|
-- @return #CARGO_REPRESENTABLE
|
||||||
function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
|
function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
|
||||||
@ -350,7 +350,7 @@ do -- CARGO_UNIT
|
|||||||
|
|
||||||
--- CARGO_UNIT Constructor.
|
--- CARGO_UNIT Constructor.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Unit#UNIT CargoUnit
|
-- @param Wrapper.Unit#UNIT CargoUnit
|
||||||
-- @param #string Type
|
-- @param #string Type
|
||||||
-- @param #string Name
|
-- @param #string Name
|
||||||
-- @param #number Weight
|
-- @param #number Weight
|
||||||
@ -371,7 +371,7 @@ end
|
|||||||
|
|
||||||
--- Enter UnBoarding State.
|
--- Enter UnBoarding State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -416,7 +416,7 @@ end
|
|||||||
|
|
||||||
--- Leave UnBoarding State.
|
--- Leave UnBoarding State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -440,7 +440,7 @@ end
|
|||||||
|
|
||||||
--- UnBoard Event.
|
--- UnBoard Event.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -465,7 +465,7 @@ end
|
|||||||
|
|
||||||
--- Enter UnLoaded State.
|
--- Enter UnLoaded State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Point#POINT_VEC2
|
-- @param Core.Point#POINT_VEC2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -503,7 +503,7 @@ end
|
|||||||
|
|
||||||
--- Enter Boarding State.
|
--- Enter Boarding State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -535,7 +535,7 @@ end
|
|||||||
|
|
||||||
--- Leave Boarding State.
|
--- Leave Boarding State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -553,7 +553,7 @@ end
|
|||||||
|
|
||||||
--- Loaded State.
|
--- Loaded State.
|
||||||
-- @param #CARGO_UNIT self
|
-- @param #CARGO_UNIT self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -602,7 +602,7 @@ do -- CARGO_PACKAGE
|
|||||||
|
|
||||||
--- CARGO_PACKAGE Constructor.
|
--- CARGO_PACKAGE Constructor.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @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 Type
|
||||||
-- @param #string Name
|
-- @param #string Name
|
||||||
-- @param #number Weight
|
-- @param #number Weight
|
||||||
@ -621,11 +621,11 @@ end
|
|||||||
|
|
||||||
--- Board Event.
|
--- Board Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @param #number BoardDistance
|
-- @param #number BoardDistance
|
||||||
-- @param #number Angle
|
-- @param #number Angle
|
||||||
@ -660,7 +660,7 @@ end
|
|||||||
|
|
||||||
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
--- Check if CargoCarrier is near the Cargo to be Loaded.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
function CARGO_PACKAGE:IsNear( CargoCarrier )
|
function CARGO_PACKAGE:IsNear( CargoCarrier )
|
||||||
self:F()
|
self:F()
|
||||||
@ -679,11 +679,11 @@ end
|
|||||||
|
|
||||||
--- Boarded Event.
|
--- Boarded Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @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 )
|
function CARGO_PACKAGE:onafterOnBoarded( FsmP, Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
@ -696,7 +696,7 @@ end
|
|||||||
|
|
||||||
--- UnBoard Event.
|
--- UnBoard Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -739,11 +739,11 @@ end
|
|||||||
|
|
||||||
--- UnBoarded Event.
|
--- UnBoarded Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
function CARGO_PACKAGE:onafterUnBoarded( FsmP, Event, From, To, CargoCarrier, Speed )
|
function CARGO_PACKAGE:onafterUnBoarded( FsmP, Event, From, To, CargoCarrier, Speed )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
@ -756,11 +756,11 @@ end
|
|||||||
|
|
||||||
--- Load Event.
|
--- Load Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @param #number LoadDistance
|
-- @param #number LoadDistance
|
||||||
-- @param #number Angle
|
-- @param #number Angle
|
||||||
@ -785,7 +785,7 @@ end
|
|||||||
|
|
||||||
--- UnLoad Event.
|
--- UnLoad Event.
|
||||||
-- @param #CARGO_PACKAGE self
|
-- @param #CARGO_PACKAGE self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS FsmP
|
-- @param Fsm.Fsm#FSM_PROCESS FsmP
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -816,7 +816,7 @@ end
|
|||||||
do -- CARGO_GROUP
|
do -- CARGO_GROUP
|
||||||
|
|
||||||
--- @type 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 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.
|
-- @field #string Name A string defining the name of the cargo group. The name is the unique identifier of the cargo.
|
||||||
CARGO_GROUP = {
|
CARGO_GROUP = {
|
||||||
@ -825,7 +825,7 @@ do -- CARGO_GROUP
|
|||||||
|
|
||||||
--- CARGO_GROUP constructor.
|
--- CARGO_GROUP constructor.
|
||||||
-- @param #CARGO_GROUP self
|
-- @param #CARGO_GROUP self
|
||||||
-- @param Set#Set_BASE CargoSet
|
-- @param Core.Set#Set_BASE CargoSet
|
||||||
-- @param #string Type
|
-- @param #string Type
|
||||||
-- @param #string Name
|
-- @param #string Name
|
||||||
-- @param #number Weight
|
-- @param #number Weight
|
||||||
@ -847,14 +847,14 @@ end -- CARGO_GROUP
|
|||||||
do -- CARGO_GROUPED
|
do -- CARGO_GROUPED
|
||||||
|
|
||||||
--- @type CARGO_GROUPED
|
--- @type CARGO_GROUPED
|
||||||
-- @extends Cargo#CARGO_GROUP
|
-- @extends Fsm.Cargo#CARGO_GROUP
|
||||||
CARGO_GROUPED = {
|
CARGO_GROUPED = {
|
||||||
ClassName = "CARGO_GROUPED",
|
ClassName = "CARGO_GROUPED",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- CARGO_GROUPED constructor.
|
--- CARGO_GROUPED constructor.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Set#Set_BASE CargoSet
|
-- @param Core.Set#Set_BASE CargoSet
|
||||||
-- @param #string Type
|
-- @param #string Type
|
||||||
-- @param #string Name
|
-- @param #string Name
|
||||||
-- @param #number Weight
|
-- @param #number Weight
|
||||||
@ -870,7 +870,7 @@ end
|
|||||||
|
|
||||||
--- Enter Boarding State.
|
--- Enter Boarding State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -893,7 +893,7 @@ end
|
|||||||
|
|
||||||
--- Enter Loaded State.
|
--- Enter Loaded State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -910,7 +910,7 @@ end
|
|||||||
|
|
||||||
--- Leave Boarding State.
|
--- Leave Boarding State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Unit#UNIT CargoCarrier
|
-- @param Wrapper.Unit#UNIT CargoCarrier
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -937,7 +937,7 @@ end
|
|||||||
|
|
||||||
--- Enter UnBoarding State.
|
--- Enter UnBoarding State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -963,7 +963,7 @@ end
|
|||||||
|
|
||||||
--- Leave UnBoarding State.
|
--- Leave UnBoarding State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -998,7 +998,7 @@ end
|
|||||||
|
|
||||||
--- UnBoard Event.
|
--- UnBoard Event.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Point#POINT_VEC2 ToPointVec2
|
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -1012,7 +1012,7 @@ end
|
|||||||
|
|
||||||
--- Enter UnLoaded State.
|
--- Enter UnLoaded State.
|
||||||
-- @param #CARGO_GROUPED self
|
-- @param #CARGO_GROUPED self
|
||||||
-- @param Point#POINT_VEC2
|
-- @param Core.Point#POINT_VEC2
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @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.
|
-- 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
|
-- 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
|
-- @module StateMachine
|
||||||
-- @author FlightControl
|
-- @author FlightControl
|
||||||
|
|
||||||
|
|
||||||
--- STATEMACHINE class
|
--- FSM class
|
||||||
-- @type STATEMACHINE
|
-- @type FSM
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
STATEMACHINE = {
|
FSM = {
|
||||||
ClassName = "STATEMACHINE",
|
ClassName = "FSM",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE object.
|
--- Creates a new FSM object.
|
||||||
-- @param #STATEMACHINE self
|
-- @param #FSM self
|
||||||
-- @return #STATEMACHINE
|
-- @return #FSM
|
||||||
function STATEMACHINE:New( FsmT )
|
function FSM:New( FsmT )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- Inherits from BASE
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
@ -49,7 +49,7 @@ function STATEMACHINE:New( FsmT )
|
|||||||
|
|
||||||
self.Scores = {}
|
self.Scores = {}
|
||||||
|
|
||||||
FsmT = FsmT or STATEMACHINE_TEMPLATE:New( "" )
|
FsmT = FsmT or FSM_TEMPLATE:New( "" )
|
||||||
|
|
||||||
self:SetStartState( FsmT:GetStartState() )
|
self:SetStartState( FsmT:GetStartState() )
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ function STATEMACHINE:New( FsmT )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE:AddTransition( From, Event, To )
|
function FSM:AddTransition( From, Event, To )
|
||||||
|
|
||||||
local event = {}
|
local event = {}
|
||||||
event.from = From
|
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.
|
--- 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
|
-- @return Process#PROCESS
|
||||||
function STATEMACHINE:AddProcess( From, Event, Process, ReturnEvents )
|
function FSM:AddProcess( From, Event, Process, ReturnEvents )
|
||||||
|
|
||||||
local sub = {}
|
local sub = {}
|
||||||
sub.FromParent = From
|
sub.FromParent = From
|
||||||
@ -96,21 +96,21 @@ function STATEMACHINE:AddProcess( From, Event, Process, ReturnEvents )
|
|||||||
return Process
|
return Process
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:AddEndState( State )
|
function FSM:AddEndState( State )
|
||||||
self.endstates[State] = State
|
self.endstates[State] = State
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:SetStartState( State )
|
function FSM:SetStartState( State )
|
||||||
self.current = State
|
self.current = State
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:GetSubs()
|
function FSM:GetSubs()
|
||||||
|
|
||||||
return self.options.subs
|
return self.options.subs
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE:LoadCallBacks( CallBackTable )
|
function FSM:LoadCallBacks( CallBackTable )
|
||||||
|
|
||||||
for name, callback in pairs( CallBackTable or {} ) do
|
for name, callback in pairs( CallBackTable or {} ) do
|
||||||
self[name] = callback
|
self[name] = callback
|
||||||
@ -118,7 +118,7 @@ function STATEMACHINE:LoadCallBacks( CallBackTable )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_eventmap( events, event )
|
function FSM:_eventmap( events, event )
|
||||||
|
|
||||||
local name = event.name
|
local name = event.name
|
||||||
local __name = "__" .. event.name
|
local __name = "__" .. event.name
|
||||||
@ -130,7 +130,7 @@ function STATEMACHINE:_eventmap( events, event )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_submap( subs, sub, name )
|
function FSM:_submap( subs, sub, name )
|
||||||
self:F( { sub = sub, name = name } )
|
self:F( { sub = sub, name = name } )
|
||||||
subs[sub.FromParent] = subs[sub.FromParent] or {}
|
subs[sub.FromParent] = subs[sub.FromParent] or {}
|
||||||
subs[sub.FromParent][sub.EventParent] = subs[sub.FromParent][sub.EventParent] or {}
|
subs[sub.FromParent][sub.EventParent] = subs[sub.FromParent][sub.EventParent] or {}
|
||||||
@ -147,14 +147,14 @@ function STATEMACHINE:_submap( subs, sub, name )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE:_call_handler(handler, params)
|
function FSM:_call_handler(handler, params)
|
||||||
if self[handler] then
|
if self[handler] then
|
||||||
self:E( "Calling " .. handler )
|
self:E( "Calling " .. handler )
|
||||||
return self[handler]( self, unpack(params) )
|
return self[handler]( self, unpack(params) )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE._handler( self, EventName, ... )
|
function FSM._handler( self, EventName, ... )
|
||||||
|
|
||||||
self:E( { EventName, ... } )
|
self:E( { EventName, ... } )
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ function STATEMACHINE._handler( self, EventName, ... )
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_delayed_transition( EventName )
|
function FSM:_delayed_transition( EventName )
|
||||||
self:E( { EventName = EventName } )
|
self:E( { EventName = EventName } )
|
||||||
return function( self, DelaySeconds, ... )
|
return function( self, DelaySeconds, ... )
|
||||||
self:T( "Delayed Event: " .. EventName )
|
self:T( "Delayed Event: " .. EventName )
|
||||||
@ -233,12 +233,12 @@ function STATEMACHINE:_delayed_transition( EventName )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_create_transition( EventName )
|
function FSM:_create_transition( EventName )
|
||||||
self:E( { Event = EventName } )
|
self:E( { Event = EventName } )
|
||||||
return function( self, ... ) return self._handler( self, EventName , ... ) end
|
return function( self, ... ) return self._handler( self, EventName , ... ) end
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_gosub( ParentFrom, ParentEvent )
|
function FSM:_gosub( ParentFrom, ParentEvent )
|
||||||
local fsmtable = {}
|
local fsmtable = {}
|
||||||
if self.subs[ParentFrom] and self.subs[ParentFrom][ParentEvent] then
|
if self.subs[ParentFrom] and self.subs[ParentFrom][ParentEvent] then
|
||||||
self:E( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
|
self:E( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
|
||||||
@ -248,7 +248,7 @@ function STATEMACHINE:_gosub( ParentFrom, ParentEvent )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_isendstate( Current )
|
function FSM:_isendstate( Current )
|
||||||
local FSMParent = self.fsmparent
|
local FSMParent = self.fsmparent
|
||||||
if FSMParent and self.endstates[Current] then
|
if FSMParent and self.endstates[Current] then
|
||||||
self:E( { state = Current, endstates = self.endstates, endstate = self.endstates[Current] } )
|
self:E( { state = Current, endstates = self.endstates, endstate = self.endstates[Current] } )
|
||||||
@ -268,7 +268,7 @@ function STATEMACHINE:_isendstate( Current )
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:_add_to_map(map, event)
|
function FSM:_add_to_map(map, event)
|
||||||
self:F3( { map, event } )
|
self:F3( { map, event } )
|
||||||
if type(event.from) == 'string' then
|
if type(event.from) == 'string' then
|
||||||
map[event.from] = event.to
|
map[event.from] = event.to
|
||||||
@ -280,31 +280,31 @@ function STATEMACHINE:_add_to_map(map, event)
|
|||||||
self:T3( { map, event } )
|
self:T3( { map, event } )
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:GetState()
|
function FSM:GetState()
|
||||||
return self.current
|
return self.current
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE:Is( State )
|
function FSM:Is( State )
|
||||||
return self.current == State
|
return self.current == State
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:is(state)
|
function FSM:is(state)
|
||||||
return self.current == state
|
return self.current == state
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:can(e)
|
function FSM:can(e)
|
||||||
local event = self.events[e]
|
local event = self.events[e]
|
||||||
self:F3( { self.current, event } )
|
self:F3( { self.current, event } )
|
||||||
local to = event and event.map[self.current] or event.map['*']
|
local to = event and event.map[self.current] or event.map['*']
|
||||||
return to ~= nil, to
|
return to ~= nil, to
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:cannot(e)
|
function FSM:cannot(e)
|
||||||
return not self:can(e)
|
return not self:can(e)
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE:CopyCallHandlers( FsmT )
|
function FSM:CopyCallHandlers( FsmT )
|
||||||
|
|
||||||
local Parent = BASE:GetParent( FsmT )
|
local Parent = BASE:GetParent( FsmT )
|
||||||
if Parent then
|
if Parent then
|
||||||
@ -325,7 +325,7 @@ function STATEMACHINE:CopyCallHandlers( FsmT )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE:todot(filename)
|
function FSM:todot(filename)
|
||||||
local dotfile = io.open(filename,'w')
|
local dotfile = io.open(filename,'w')
|
||||||
dotfile:write('digraph {\n')
|
dotfile:write('digraph {\n')
|
||||||
local transition = function(event,from,to)
|
local transition = function(event,from,to)
|
||||||
@ -348,8 +348,8 @@ end
|
|||||||
|
|
||||||
--- STATEMACHINE_CONTROLLABLE class
|
--- STATEMACHINE_CONTROLLABLE class
|
||||||
-- @type STATEMACHINE_CONTROLLABLE
|
-- @type STATEMACHINE_CONTROLLABLE
|
||||||
-- @field Controllable#CONTROLLABLE Controllable
|
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @extends Core.StateMachine#STATEMACHINE
|
-- @extends Core.StateMachine#FSM
|
||||||
STATEMACHINE_CONTROLLABLE = {
|
STATEMACHINE_CONTROLLABLE = {
|
||||||
ClassName = "STATEMACHINE_CONTROLLABLE",
|
ClassName = "STATEMACHINE_CONTROLLABLE",
|
||||||
}
|
}
|
||||||
@ -357,12 +357,12 @@ STATEMACHINE_CONTROLLABLE = {
|
|||||||
--- Creates a new STATEMACHINE_CONTROLLABLE object.
|
--- Creates a new STATEMACHINE_CONTROLLABLE object.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||||
-- @param #table FSMT Finite State Machine Table
|
-- @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
|
-- @return #STATEMACHINE_CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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
|
if Controllable then
|
||||||
self:SetControllable( Controllable )
|
self:SetControllable( Controllable )
|
||||||
@ -373,7 +373,7 @@ end
|
|||||||
|
|
||||||
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||||
-- @param Controllable#CONTROLLABLE FSMControllable
|
-- @param Wrapper.Controllable#CONTROLLABLE FSMControllable
|
||||||
-- @return #STATEMACHINE_CONTROLLABLE
|
-- @return #STATEMACHINE_CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
|
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
|
||||||
self:F( FSMControllable )
|
self:F( FSMControllable )
|
||||||
@ -382,7 +382,7 @@ end
|
|||||||
|
|
||||||
--- Gets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
--- Gets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #STATEMACHINE_CONTROLLABLE self
|
||||||
-- @return Controllable#CONTROLLABLE
|
-- @return Wrapper.Controllable#CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:GetControllable()
|
function STATEMACHINE_CONTROLLABLE:GetControllable()
|
||||||
return self.Controllable
|
return self.Controllable
|
||||||
end
|
end
|
||||||
@ -406,21 +406,21 @@ function STATEMACHINE_CONTROLLABLE:_call_handler( handler, params )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- STATEMACHINE_PROCESS class
|
--- FSM_PROCESS class
|
||||||
-- @type STATEMACHINE_PROCESS
|
-- @type FSM_PROCESS
|
||||||
-- @field Process#PROCESS Process
|
-- @field Process#PROCESS Process
|
||||||
-- @field Tasking.Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
||||||
STATEMACHINE_PROCESS = {
|
FSM_PROCESS = {
|
||||||
ClassName = "STATEMACHINE_PROCESS",
|
ClassName = "FSM_PROCESS",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE_PROCESS object.
|
--- Creates a new FSM_PROCESS object.
|
||||||
-- @param #STATEMACHINE_PROCESS self
|
-- @param #FSM_PROCESS self
|
||||||
-- @return #STATEMACHINE_PROCESS
|
-- @return #FSM_PROCESS
|
||||||
function STATEMACHINE_PROCESS:New( FsmT, Controllable, Task )
|
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:Assign( Controllable, Task )
|
||||||
self.ClassName = FsmT._Name
|
self.ClassName = FsmT._Name
|
||||||
@ -431,13 +431,19 @@ function STATEMACHINE_PROCESS:New( FsmT, Controllable, Task )
|
|||||||
|
|
||||||
for ProcessID, Process in pairs( FsmT:GetProcesses() ) do
|
for ProcessID, Process in pairs( FsmT:GetProcesses() ) do
|
||||||
self:E( Process )
|
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
|
end
|
||||||
|
|
||||||
for EndStateID, EndState in pairs( FsmT:GetEndStates() ) do
|
for EndStateID, EndState in pairs( FsmT:GetEndStates() ) do
|
||||||
self:E( EndState )
|
self:E( EndState )
|
||||||
self:AddEndState( EndState )
|
self:AddEndState( EndState )
|
||||||
end
|
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
|
return self
|
||||||
end
|
end
|
||||||
@ -446,7 +452,7 @@ end
|
|||||||
-- @param #PROCESS self
|
-- @param #PROCESS self
|
||||||
-- @param Tasking.Task#TASK_BASE Task
|
-- @param Tasking.Task#TASK_BASE Task
|
||||||
-- @return #PROCESS
|
-- @return #PROCESS
|
||||||
function STATEMACHINE_PROCESS:SetTask( Task )
|
function FSM_PROCESS:SetTask( Task )
|
||||||
|
|
||||||
self.Task = Task
|
self.Task = Task
|
||||||
|
|
||||||
@ -455,27 +461,27 @@ end
|
|||||||
|
|
||||||
--- Gets the task of the process.
|
--- Gets the task of the process.
|
||||||
-- @param #PROCESS self
|
-- @param #PROCESS self
|
||||||
-- @return Task#TASK_BASE
|
-- @return Tasking.Task#TASK_BASE
|
||||||
function STATEMACHINE_PROCESS:GetTask()
|
function FSM_PROCESS:GetTask()
|
||||||
|
|
||||||
return self.Task
|
return self.Task
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets the mission of the process.
|
--- Gets the mission of the process.
|
||||||
-- @param #PROCESS self
|
-- @param #PROCESS self
|
||||||
-- @return Mission#MISSION
|
-- @return Tasking.Mission#MISSION
|
||||||
function STATEMACHINE_PROCESS:GetMission()
|
function FSM_PROCESS:GetMission()
|
||||||
|
|
||||||
return self.Task.Mission
|
return self.Task.Mission
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Assign the process to a @{Unit} and activate the process.
|
--- 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 Task.Tasking#TASK_BASE Task
|
||||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @return #STATEMACHINE_PROCESS self
|
-- @return #FSM_PROCESS self
|
||||||
function STATEMACHINE_PROCESS:Assign( ProcessUnit, Task )
|
function FSM_PROCESS:Assign( ProcessUnit, Task )
|
||||||
self:E( { Task, ProcessUnit } )
|
self:E( { Task, ProcessUnit } )
|
||||||
|
|
||||||
self:SetControllable( ProcessUnit )
|
self:SetControllable( ProcessUnit )
|
||||||
@ -486,31 +492,47 @@ function STATEMACHINE_PROCESS:Assign( ProcessUnit, Task )
|
|||||||
return self
|
return self
|
||||||
end
|
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:E( "Assign" )
|
||||||
|
|
||||||
self.Task:Assign()
|
self.Task:Assign()
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_PROCESS:onenterFailed( ProcessUnit )
|
function FSM_PROCESS:onenterFailed( ProcessUnit )
|
||||||
self:E( "Failed" )
|
self:E( "Failed" )
|
||||||
|
|
||||||
self.Task:Fail()
|
self.Task:Fail()
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_PROCESS:onenterSuccess( ProcessUnit )
|
function FSM_PROCESS:onenterSuccess( ProcessUnit )
|
||||||
self:E( "Success" )
|
self:E( "Success" )
|
||||||
|
|
||||||
self.Task:Success()
|
self.Task:Success()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- StateMachine callback function for a STATEMACHINE_PROCESS
|
--- StateMachine callback function for a FSM_PROCESS
|
||||||
-- @param #STATEMACHINE_PROCESS self
|
-- @param #FSM_PROCESS self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @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() } )
|
self:E( { ProcessUnit, Event, From, To, Dummy, self:IsTrace() } )
|
||||||
|
|
||||||
if self:IsTrace() then
|
if self:IsTrace() then
|
||||||
@ -529,55 +551,55 @@ function STATEMACHINE_PROCESS:onstatechange( ProcessUnit, Event, From, To, Dummy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- STATEMACHINE_TASK class
|
--- FSM_TASK class
|
||||||
-- @type STATEMACHINE_TASK
|
-- @type FSM_TASK
|
||||||
-- @field Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @extends Core.StateMachine#STATEMACHINE
|
-- @extends Core.StateMachine#FSM
|
||||||
STATEMACHINE_TASK = {
|
FSM_TASK = {
|
||||||
ClassName = "STATEMACHINE_TASK",
|
ClassName = "FSM_TASK",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE_TASK object.
|
--- Creates a new FSM_TASK object.
|
||||||
-- @param #STATEMACHINE_TASK self
|
-- @param #FSM_TASK self
|
||||||
-- @param #table FSMT
|
-- @param #table FSMT
|
||||||
-- @param Task#TASK_BASE Task
|
-- @param Tasking.Task#TASK_BASE Task
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return #STATEMACHINE_TASK
|
-- @return #FSM_TASK
|
||||||
function STATEMACHINE_TASK:New( FSMT )
|
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
|
self["onstatechange"] = self.OnStateChange
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TASK:_call_handler( handler, params )
|
function FSM_TASK:_call_handler( handler, params )
|
||||||
if self[handler] then
|
if self[handler] then
|
||||||
self:E( "Calling " .. handler )
|
self:E( "Calling " .. handler )
|
||||||
return self[handler]( self, unpack( params ) )
|
return self[handler]( self, unpack( params ) )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- STATEMACHINE_SET
|
do -- FSM_SET
|
||||||
|
|
||||||
--- STATEMACHINE_SET class
|
--- FSM_SET class
|
||||||
-- @type STATEMACHINE_SET
|
-- @type FSM_SET
|
||||||
-- @field Set#SET_BASE Set
|
-- @field Core.Set#SET_BASE Set
|
||||||
-- @extends StateMachine#STATEMACHINE
|
-- @extends Fsm.Fsm#FSM
|
||||||
STATEMACHINE_SET = {
|
FSM_SET = {
|
||||||
ClassName = "STATEMACHINE_SET",
|
ClassName = "FSM_SET",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE_SET object.
|
--- Creates a new FSM_SET object.
|
||||||
-- @param #STATEMACHINE_SET self
|
-- @param #FSM_SET self
|
||||||
-- @param #table FSMT Finite State Machine Table
|
-- @param #table FSMT Finite State Machine Table
|
||||||
-- @param Set_SET_BASE FSMSet (optional) The Set object that the STATEMACHINE_SET governs.
|
-- @param Set_SET_BASE FSMSet (optional) The Set object that the FSM_SET governs.
|
||||||
-- @return #STATEMACHINE_SET
|
-- @return #FSM_SET
|
||||||
function STATEMACHINE_SET:New( FSMT, FSMSet )
|
function FSM_SET:New( FSMT, FSMSet )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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
|
if FSMSet then
|
||||||
self:Set( FSMSet )
|
self:Set( FSMSet )
|
||||||
@ -586,23 +608,23 @@ function STATEMACHINE_SET:New( FSMT, FSMSet )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Sets the SET_BASE object that the STATEMACHINE_SET governs.
|
--- Sets the SET_BASE object that the FSM_SET governs.
|
||||||
-- @param #STATEMACHINE_SET self
|
-- @param #FSM_SET self
|
||||||
-- @param Set#SET_BASE FSMSet
|
-- @param Core.Set#SET_BASE FSMSet
|
||||||
-- @return #STATEMACHINE_SET
|
-- @return #FSM_SET
|
||||||
function STATEMACHINE_SET:Set( FSMSet )
|
function FSM_SET:Set( FSMSet )
|
||||||
self:F( FSMSet )
|
self:F( FSMSet )
|
||||||
self.Set = FSMSet
|
self.Set = FSMSet
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets the SET_BASE object that the STATEMACHINE_SET governs.
|
--- Gets the SET_BASE object that the FSM_SET governs.
|
||||||
-- @param #STATEMACHINE_SET self
|
-- @param #FSM_SET self
|
||||||
-- @return Set#SET_BASE
|
-- @return Core.Set#SET_BASE
|
||||||
function STATEMACHINE_SET:Get()
|
function FSM_SET:Get()
|
||||||
return self.Controllable
|
return self.Controllable
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_SET:_call_handler( handler, params )
|
function FSM_SET:_call_handler( handler, params )
|
||||||
if self[handler] then
|
if self[handler] then
|
||||||
self:E( "Calling " .. handler )
|
self:E( "Calling " .. handler )
|
||||||
return self[handler]( self, self.Set, unpack( params ) )
|
return self[handler]( self, self.Set, unpack( params ) )
|
||||||
@ -611,20 +633,20 @@ end
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- STATEMACHINE_TEMPLATE class
|
--- FSM_TEMPLATE class
|
||||||
-- @type STATEMACHINE_TEMPLATE
|
-- @type FSM_TEMPLATE
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
STATEMACHINE_TEMPLATE = {
|
FSM_TEMPLATE = {
|
||||||
ClassName = "STATEMACHINE_TEMPLATE",
|
ClassName = "FSM_TEMPLATE",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE_TEMPLATE object.
|
--- Creates a new FSM_TEMPLATE object.
|
||||||
-- @param #STATEMACHINE_TEMPLATE self
|
-- @param #FSM_TEMPLATE self
|
||||||
-- @return #STATEMACHINE_TEMPLATE
|
-- @return #FSM_TEMPLATE
|
||||||
function STATEMACHINE_TEMPLATE:New( Name )
|
function FSM_TEMPLATE:New( Name )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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._StartState = "none"
|
||||||
self._Transitions = {}
|
self._Transitions = {}
|
||||||
@ -637,7 +659,7 @@ function STATEMACHINE_TEMPLATE:New( Name )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:AddTransition( From, Event, To )
|
function FSM_TEMPLATE:AddTransition( From, Event, To )
|
||||||
|
|
||||||
local Transition = {}
|
local Transition = {}
|
||||||
Transition.From = From
|
Transition.From = From
|
||||||
@ -647,14 +669,14 @@ function STATEMACHINE_TEMPLATE:AddTransition( From, Event, To )
|
|||||||
self._Transitions[Transition] = Transition
|
self._Transitions[Transition] = Transition
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetTransitions()
|
function FSM_TEMPLATE:GetTransitions()
|
||||||
|
|
||||||
return self._Transitions or {}
|
return self._Transitions or {}
|
||||||
end
|
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.
|
--- 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
|
-- @return Process#PROCESS
|
||||||
function STATEMACHINE_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnEvents )
|
function FSM_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnEvents )
|
||||||
|
|
||||||
self:E( { ProcessTemplate = ProcessTemplate } )
|
self:E( { ProcessTemplate = ProcessTemplate } )
|
||||||
|
|
||||||
@ -674,12 +696,12 @@ function STATEMACHINE_TEMPLATE:AddProcess( From, Event, ProcessTemplate, ReturnE
|
|||||||
return ProcessTemplate
|
return ProcessTemplate
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetProcesses()
|
function FSM_TEMPLATE:GetProcesses()
|
||||||
|
|
||||||
return self._Processes or {}
|
return self._Processes or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetProcess( From, Event )
|
function FSM_TEMPLATE:GetProcess( From, Event )
|
||||||
|
|
||||||
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
||||||
if Process.From == From and Process.Event == Event then
|
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!" )
|
error( "Sub-Process from state " .. From .. " with event " .. Event .. " not found!" )
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:SetParameters( Parameters )
|
function FSM_TEMPLATE:SetParameters( Parameters )
|
||||||
self._Parameters = Parameters
|
self._Parameters = Parameters
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetParameters()
|
function FSM_TEMPLATE:GetParameters()
|
||||||
return self._Parameters or {}
|
return self._Parameters or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:AddEndState( State )
|
function FSM_TEMPLATE:AddEndState( State )
|
||||||
|
|
||||||
self._EndStates[State] = State
|
self._EndStates[State] = State
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetEndStates()
|
function FSM_TEMPLATE:GetEndStates()
|
||||||
|
|
||||||
return self._EndStates or {}
|
return self._EndStates or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:SetStartState( State )
|
function FSM_TEMPLATE:SetStartState( State )
|
||||||
|
|
||||||
self._StartState = State
|
self._StartState = State
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_TEMPLATE:GetStartState()
|
function FSM_TEMPLATE:GetStartState()
|
||||||
|
|
||||||
return self._StartState or {}
|
return self._StartState or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Adds a score for the STATEMACHINE_PROCESS to be achieved.
|
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||||
-- @param #STATEMACHINE_TEMPLATE self
|
-- @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 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 #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.
|
-- @param #number Score is a number providing the score of the status.
|
||||||
-- @return #STATEMACHINE_TEMPLATE self
|
-- @return #FSM_TEMPLATE self
|
||||||
function STATEMACHINE_TEMPLATE:AddScore( State, ScoreText, Score )
|
function FSM_TEMPLATE:AddScore( State, ScoreText, Score )
|
||||||
self:F2( { State, ScoreText, Score } )
|
self:F2( { State, ScoreText, Score } )
|
||||||
|
|
||||||
self._Scores[State] = self._Scores[State] or {}
|
self._Scores[State] = self._Scores[State] or {}
|
||||||
@ -736,15 +758,15 @@ function STATEMACHINE_TEMPLATE:AddScore( State, ScoreText, Score )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Adds a score for the STATEMACHINE_PROCESS to be achieved.
|
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||||
-- @param #STATEMACHINE_TEMPLATE self
|
-- @param #FSM_TEMPLATE self
|
||||||
-- @param #string From is the From State of the main process.
|
-- @param #string From is the From State of the main process.
|
||||||
-- @param #string Event is the Event 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 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 #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.
|
-- @param #number Score is a number providing the score of the status.
|
||||||
-- @return #STATEMACHINE_TEMPLATE self
|
-- @return #FSM_TEMPLATE self
|
||||||
function STATEMACHINE_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, Score )
|
function FSM_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, Score )
|
||||||
self:F2( { Event, State, ScoreText, Score } )
|
self:F2( { Event, State, ScoreText, Score } )
|
||||||
|
|
||||||
local Process = self:GetProcess( From, Event )
|
local Process = self:GetProcess( From, Event )
|
||||||
@ -757,3 +779,7 @@ function STATEMACHINE_TEMPLATE:AddScoreProcess( From, Event, State, ScoreText, S
|
|||||||
return Process
|
return Process
|
||||||
end
|
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 @{#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,
|
-- 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
|
-- --- State transition function for the PATROLZONE **Patrol** object
|
||||||
-- -- @param #PATROLZONE self
|
-- -- @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.
|
-- -- @return #boolean If false is returned, then the OnAfter state transition method will not be called.
|
||||||
-- function Patrol:OnBeforeRTB( AIGroup )
|
-- function Patrol:OnBeforeRTB( AIGroup )
|
||||||
-- AIGroup:MessageToRed( "Returning to base", 20 )
|
-- AIGroup:MessageToRed( "Returning to base", 20 )
|
||||||
@ -78,8 +78,8 @@
|
|||||||
--
|
--
|
||||||
-- --- State transition function for the PATROLZONE **Patrol** object
|
-- --- State transition function for the PATROLZONE **Patrol** object
|
||||||
-- -- @param #PATROLZONE self
|
-- -- @param #PATROLZONE self
|
||||||
-- -- @param Controllable#CONTROLLABLE AIGroup
|
-- -- @param Wrapper.Controllable#CONTROLLABLE AIGroup
|
||||||
-- -- @return #Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
|
-- -- @return #Wrapper.Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
|
||||||
-- function Patrol:OnAfterRTB( AIGroup )
|
-- function Patrol:OnAfterRTB( AIGroup )
|
||||||
-- return PatrolSpawn:Spawn()
|
-- return PatrolSpawn:Spawn()
|
||||||
-- end
|
-- end
|
||||||
@ -137,25 +137,25 @@
|
|||||||
--- OnBefore State Transition Function
|
--- OnBefore State Transition Function
|
||||||
-- @function [parent=#PATROLZONE] OnBeforeRoute
|
-- @function [parent=#PATROLZONE] OnBeforeRoute
|
||||||
-- @param #PATROLZONE self
|
-- @param #PATROLZONE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
--- OnAfter State Transition Function
|
--- OnAfter State Transition Function
|
||||||
-- @function [parent=#PATROLZONE] OnAfterRoute
|
-- @function [parent=#PATROLZONE] OnAfterRoute
|
||||||
-- @param #PATROLZONE self
|
-- @param #PATROLZONE self
|
||||||
-- @param Controllable#CONTROLLABLE Controllable
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- PATROLZONE class
|
--- PATROLZONE class
|
||||||
-- @type PATROLZONE
|
-- @type PATROLZONE
|
||||||
-- @field Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
||||||
-- @field Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
-- @field Core.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 Dcs.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 Dcs.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 Dcs.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.
|
-- @field Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||||
-- @extends StateMachine#STATEMACHINE_CONTROLLABLE
|
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
||||||
PATROLZONE = {
|
PATROLZONE = {
|
||||||
ClassName = "PATROLZONE",
|
ClassName = "PATROLZONE",
|
||||||
}
|
}
|
||||||
@ -164,11 +164,11 @@ PATROLZONE = {
|
|||||||
|
|
||||||
--- Creates a new PATROLZONE object
|
--- Creates a new PATROLZONE object
|
||||||
-- @param #PATROLZONE self
|
-- @param #PATROLZONE self
|
||||||
-- @param Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
-- @param Core.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 Dcs.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 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 Dcs.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 PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||||
-- @return #PATROLZONE self
|
-- @return #PATROLZONE self
|
||||||
-- @usage
|
-- @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.
|
-- -- 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.
|
--- Sets (modifies) the minimum and maximum speed of the patrol.
|
||||||
-- @param #PATROLZONE self
|
-- @param #PATROLZONE self
|
||||||
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
-- @param Dcs.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 PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||||
-- @return #PATROLZONE self
|
-- @return #PATROLZONE self
|
||||||
function PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
|
function PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
|
||||||
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
|
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
|
||||||
@ -220,8 +220,8 @@ end
|
|||||||
|
|
||||||
--- Sets the floor and ceiling altitude of the patrol.
|
--- Sets the floor and ceiling altitude of the patrol.
|
||||||
-- @param #PATROLZONE self
|
-- @param #PATROLZONE self
|
||||||
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
-- @param Dcs.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 PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||||
-- @return #PATROLZONE self
|
-- @return #PATROLZONE self
|
||||||
function PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
|
function PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
|
||||||
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
|
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
|
||||||
@ -232,7 +232,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param Controllable#CONTROLLABLE AIControllable
|
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
function _NewPatrolRoute( AIControllable )
|
function _NewPatrolRoute( AIControllable )
|
||||||
|
|
||||||
AIControllable:T( "NewPatrolRoute" )
|
AIControllable:T( "NewPatrolRoute" )
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
--- The PROCESS class
|
--- The PROCESS class
|
||||||
-- @type PROCESS
|
-- @type PROCESS
|
||||||
-- @field Task#TASK_BASE ProcessTask
|
-- @field Tasking.Task#TASK_BASE ProcessTask
|
||||||
-- @field Group#GROUP ProcessGroup
|
-- @field Wrapper.Group#GROUP ProcessGroup
|
||||||
-- @field Menu#MENU_GROUP MissionMenu
|
-- @field Core.Menu#MENU_GROUP MissionMenu
|
||||||
-- @field #string ProcessName
|
-- @field #string ProcessName
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
-- @extends Core.StateMachine#STATEMACHINE_CONTROLLABLE
|
||||||
PROCESS = {
|
PROCESS = {
|
||||||
@ -16,10 +16,10 @@ PROCESS = {
|
|||||||
--- Instantiates a new TASK Base. Should never be used. Interface Class.
|
--- Instantiates a new TASK Base. Should never be used. Interface Class.
|
||||||
-- @param #PROCESS self
|
-- @param #PROCESS self
|
||||||
-- @param #string ProcessName
|
-- @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
|
-- @return #PROCESS
|
||||||
function PROCESS:New( FSMT, ProcessName, ProcessUnit )
|
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()
|
self:F()
|
||||||
|
|
||||||
if ProcessUnit then
|
if ProcessUnit then
|
||||||
@ -35,7 +35,7 @@ end
|
|||||||
|
|
||||||
--- Gets the Group of the process.
|
--- Gets the Group of the process.
|
||||||
-- @param #PROCESS self
|
-- @param #PROCESS self
|
||||||
-- @return Group#GROUP
|
-- @return Wrapper.Group#GROUP
|
||||||
function PROCESS:GetGroup()
|
function PROCESS:GetGroup()
|
||||||
|
|
||||||
return self.ProcessGroup
|
return self.ProcessGroup
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
--- PROCESS_JTAC class
|
--- PROCESS_JTAC class
|
||||||
-- @type PROCESS_JTAC
|
-- @type PROCESS_JTAC
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Set#SET_UNIT TargetSetUnit
|
-- @field Core.Set#SET_UNIT TargetSetUnit
|
||||||
-- @extends Process#PROCESS
|
-- @extends Process#PROCESS
|
||||||
PROCESS_JTAC = {
|
PROCESS_JTAC = {
|
||||||
ClassName = "PROCESS_JTAC",
|
ClassName = "PROCESS_JTAC",
|
||||||
@ -14,10 +14,10 @@ PROCESS_JTAC = {
|
|||||||
|
|
||||||
--- Creates a new DESTROY process.
|
--- Creates a new DESTROY process.
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
-- @param Unit#UNIT ProcessUnit
|
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @param Set#SET_UNIT TargetSetUnit
|
-- @param Core.Set#SET_UNIT TargetSetUnit
|
||||||
-- @param Unit#UNIT FACUnit
|
-- @param Wrapper.Unit#UNIT FACUnit
|
||||||
-- @return #PROCESS_JTAC self
|
-- @return #PROCESS_JTAC self
|
||||||
function PROCESS_JTAC:New( Task, ProcessUnit, TargetSetUnit, FACUnit )
|
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.DisplayCategory = "HQ" -- Targets is the default display category
|
||||||
|
|
||||||
|
|
||||||
self.Fsm = STATEMACHINE_PROCESS:New( self, {
|
self.Fsm = FSM_PROCESS:New( self, {
|
||||||
initial = 'Assigned',
|
initial = 'Assigned',
|
||||||
events = {
|
events = {
|
||||||
{ name = 'Start', from = 'Assigned', to = 'CreatedMenu' },
|
{ name = 'Start', from = 'Assigned', to = 'CreatedMenu' },
|
||||||
@ -66,7 +66,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -77,7 +77,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -123,7 +123,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -131,7 +131,7 @@ function PROCESS_JTAC:OnJTACMenuAwait( Fsm, Event, From, To )
|
|||||||
|
|
||||||
if self.DisplayCount >= self.DisplayInterval then
|
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 {}
|
TaskJTAC.Spots = TaskJTAC.Spots or {}
|
||||||
for TargetUnitName, SpotData in pairs( TaskJTAC.Spots) do
|
for TargetUnitName, SpotData in pairs( TaskJTAC.Spots) do
|
||||||
local TargetUnit = UNIT:FindByName( TargetUnitName )
|
local TargetUnit = UNIT:FindByName( TargetUnitName )
|
||||||
@ -147,16 +147,16 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Unit#UNIT TargetUnit
|
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||||
function PROCESS_JTAC:OnJTACMenuSpot( Fsm, Event, From, To, TargetUnit )
|
function PROCESS_JTAC:OnJTACMenuSpot( Fsm, Event, From, To, TargetUnit )
|
||||||
|
|
||||||
local TargetUnitName = TargetUnit:GetName()
|
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 = TaskJTAC.Spots or {}
|
||||||
TaskJTAC.Spots[TargetUnitName] = TaskJTAC.Spots[TargetUnitName] or {}
|
TaskJTAC.Spots[TargetUnitName] = TaskJTAC.Spots[TargetUnitName] or {}
|
||||||
@ -174,16 +174,16 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_JTAC self
|
-- @param #PROCESS_JTAC self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Unit#UNIT TargetUnit
|
-- @param Wrapper.Unit#UNIT TargetUnit
|
||||||
function PROCESS_JTAC:OnJTACMenuCancel( Fsm, Event, From, To, TargetUnit )
|
function PROCESS_JTAC:OnJTACMenuCancel( Fsm, Event, From, To, TargetUnit )
|
||||||
|
|
||||||
local TargetUnitName = TargetUnit:GetName()
|
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 = TaskJTAC.Spots or {}
|
||||||
if TaskJTAC.Spots[TargetUnitName] then
|
if TaskJTAC.Spots[TargetUnitName] then
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
--- PROCESS_PICKUP class
|
--- PROCESS_PICKUP class
|
||||||
-- @type PROCESS_PICKUP
|
-- @type PROCESS_PICKUP
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Set#SET_UNIT TargetSetUnit
|
-- @field Core.Set#SET_UNIT TargetSetUnit
|
||||||
-- @extends Process#PROCESS
|
-- @extends Process#PROCESS
|
||||||
PROCESS_PICKUP = {
|
PROCESS_PICKUP = {
|
||||||
ClassName = "PROCESS_PICKUP",
|
ClassName = "PROCESS_PICKUP",
|
||||||
@ -14,9 +14,9 @@ PROCESS_PICKUP = {
|
|||||||
|
|
||||||
--- Creates a new DESTROY process.
|
--- Creates a new DESTROY process.
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
-- @param Unit#UNIT ProcessUnit
|
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @param Set#SET_UNIT TargetSetUnit
|
-- @param Core.Set#SET_UNIT TargetSetUnit
|
||||||
-- @return #PROCESS_PICKUP self
|
-- @return #PROCESS_PICKUP self
|
||||||
function PROCESS_PICKUP:New( Task, ProcessName, ProcessUnit )
|
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.DisplayTime = 10 -- 10 seconds is the default
|
||||||
self.DisplayCategory = "HQ" -- Targets is the default display category
|
self.DisplayCategory = "HQ" -- Targets is the default display category
|
||||||
|
|
||||||
self.Fsm = STATEMACHINE_PROCESS:New( self, {
|
self.Fsm = FSM_PROCESS:New( self, {
|
||||||
initial = 'Assigned',
|
initial = 'Assigned',
|
||||||
events = {
|
events = {
|
||||||
{ name = 'Start', from = 'Assigned', to = 'Navigating' },
|
{ name = 'Start', from = 'Assigned', to = 'Navigating' },
|
||||||
@ -57,7 +57,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -68,7 +68,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -89,11 +89,11 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function PROCESS_PICKUP:OnHitTarget( Fsm, Event, From, To, Event )
|
function PROCESS_PICKUP:OnHitTarget( Fsm, Event, From, To, Event )
|
||||||
|
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -126,11 +126,11 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA DCSEvent
|
-- @param Core.Event#EVENTDATA DCSEvent
|
||||||
function PROCESS_PICKUP:OnKilled( Fsm, Event, From, To )
|
function PROCESS_PICKUP:OnKilled( Fsm, Event, From, To )
|
||||||
|
|
||||||
self:NextEvent( Fsm.Restart )
|
self:NextEvent( Fsm.Restart )
|
||||||
@ -139,7 +139,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -151,7 +151,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a PROCESS
|
--- StateMachine callback function for a PROCESS
|
||||||
-- @param #PROCESS_PICKUP self
|
-- @param #PROCESS_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_PROCESS Fsm
|
-- @param Fsm.Fsm#FSM_PROCESS Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -162,7 +162,7 @@ end
|
|||||||
--- DCS Events
|
--- DCS Events
|
||||||
|
|
||||||
--- @param #PROCESS_PICKUP self
|
--- @param #PROCESS_PICKUP self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function PROCESS_PICKUP:EventDead( Event )
|
function PROCESS_PICKUP:EventDead( Event )
|
||||||
|
|
||||||
if Event.IniDCSUnit then
|
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 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.
|
-- 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
|
--- PROCESS_ROUTE class
|
||||||
-- @type PROCESS_ROUTE
|
-- @type PROCESS_ROUTE
|
||||||
-- @field Task#TASK TASK
|
-- @field Tasking.Task#TASK TASK
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Zone#ZONE_BASE TargetZone
|
-- @field Zone#ZONE_BASE TargetZone
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||||
PROCESS_ROUTE = {
|
PROCESS_ROUTE = {
|
||||||
ClassName = "PROCESS_ROUTE",
|
ClassName = "PROCESS_ROUTE",
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ do -- PROCESS_ROUTE
|
|||||||
function PROCESS_ROUTE:New()
|
function PROCESS_ROUTE:New()
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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( "None", "Start", "Routing" )
|
||||||
self:AddTransition( "*", "Report", "Reporting" )
|
self:AddTransition( "*", "Report", "Reporting" )
|
||||||
@ -119,7 +119,7 @@ do -- PROCESS_ROUTE
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ROUTE self
|
-- @param #PROCESS_ROUTE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -131,7 +131,7 @@ do -- PROCESS_ROUTE
|
|||||||
|
|
||||||
--- Check if the controllable has arrived.
|
--- Check if the controllable has arrived.
|
||||||
-- @param #PROCESS_ROUTE self
|
-- @param #PROCESS_ROUTE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
function PROCESS_ROUTE:onfuncHasArrived( ProcessUnit )
|
function PROCESS_ROUTE:onfuncHasArrived( ProcessUnit )
|
||||||
return false
|
return false
|
||||||
@ -139,7 +139,7 @@ do -- PROCESS_ROUTE
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ROUTE self
|
-- @param #PROCESS_ROUTE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -180,8 +180,8 @@ do -- PROCESS_ROUTE_ZONE
|
|||||||
|
|
||||||
--- PROCESS_ROUTE_ZONE class
|
--- PROCESS_ROUTE_ZONE class
|
||||||
-- @type PROCESS_ROUTE_ZONE
|
-- @type PROCESS_ROUTE_ZONE
|
||||||
-- @field Task#TASK TASK
|
-- @field Tasking.Task#TASK TASK
|
||||||
-- @field Unit#UNIT ProcessUnit
|
-- @field Wrapper.Unit#UNIT ProcessUnit
|
||||||
-- @field Zone#ZONE_BASE TargetZone
|
-- @field Zone#ZONE_BASE TargetZone
|
||||||
-- @extends #PROCESS_ROUTE
|
-- @extends #PROCESS_ROUTE
|
||||||
PROCESS_ROUTE_ZONE = {
|
PROCESS_ROUTE_ZONE = {
|
||||||
@ -225,7 +225,7 @@ do -- PROCESS_ROUTE_ZONE
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_ROUTE_ZONE self
|
-- @param #PROCESS_ROUTE_ZONE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @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 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.
|
-- 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
|
--- PROCESS_SMOKE class
|
||||||
-- @type PROCESS_SMOKE
|
-- @type PROCESS_SMOKE
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_TEMPLATE
|
-- @extends Core.StateMachine#FSM_TEMPLATE
|
||||||
PROCESS_SMOKE = {
|
PROCESS_SMOKE = {
|
||||||
ClassName = "PROCESS_SMOKE",
|
ClassName = "PROCESS_SMOKE",
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ do -- PROCESS_SMOKE
|
|||||||
function PROCESS_SMOKE:New()
|
function PROCESS_SMOKE:New()
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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( "None", "Start", "AwaitSmoke" )
|
||||||
self:AddTransition( "AwaitSmoke", "Next", "Smoking" )
|
self:AddTransition( "AwaitSmoke", "Next", "Smoking" )
|
||||||
@ -101,13 +101,13 @@ do -- PROCESS_SMOKE
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_SMOKE self
|
-- @param #PROCESS_SMOKE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function PROCESS_SMOKE:onafterStart( ProcessUnit, Event, From, To )
|
function PROCESS_SMOKE:onafterStart( ProcessUnit, Event, From, To )
|
||||||
|
|
||||||
local ProcessGroup = self:GetGroup()
|
local ProcessGroup = ProcessUnit:GetGroup()
|
||||||
local MissionMenu = self:GetMission():GetMissionMenu( ProcessGroup )
|
local MissionMenu = self:GetMission():GetMissionMenu( ProcessGroup )
|
||||||
|
|
||||||
local function MenuSmoke( MenuParam )
|
local function MenuSmoke( MenuParam )
|
||||||
@ -173,14 +173,14 @@ do -- PROCESS_SMOKE_TARGETS_ZONE
|
|||||||
|
|
||||||
--- StateMachine callback function
|
--- StateMachine callback function
|
||||||
-- @param #PROCESS_SMOKE_TARGETS_ZONE self
|
-- @param #PROCESS_SMOKE_TARGETS_ZONE self
|
||||||
-- @param Controllable#CONTROLLABLE ProcessUnit
|
-- @param Wrapper.Controllable#CONTROLLABLE ProcessUnit
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function PROCESS_SMOKE_TARGETS_ZONE:onenterSmoking( ProcessUnit, Event, From, To )
|
function PROCESS_SMOKE_TARGETS_ZONE:onenterSmoking( ProcessUnit, Event, From, To )
|
||||||
|
|
||||||
self.TargetSetUnit:ForEachUnit(
|
self.TargetSetUnit:ForEachUnit(
|
||||||
--- @param Unit#UNIT SmokeUnit
|
--- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( SmokeUnit )
|
function( SmokeUnit )
|
||||||
if math.random( 1, ( 100 * self.TargetSetUnit:Count() ) / 4 ) <= 100 then
|
if math.random( 1, ( 100 * self.TargetSetUnit:Count() ) / 4 ) <= 100 then
|
||||||
SCHEDULER:New( self,
|
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.
|
-- 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
|
-- The AIBALANCER class manages internally a collection of AI management objects, which govern the behaviour
|
||||||
-- of the underlying AI GROUPS.
|
-- of the underlying AI GROUPS.
|
||||||
--
|
--
|
||||||
-- The parent class @{StateMachine#STATEMACHINE_SET} manages the functionality to control the Finite State Machine (FSM)
|
-- 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 @{StateMachine#STATEMACHINE_SET.Set} object containing the
|
-- 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.
|
-- SET_GROUP and additional event parameters provided during the event.
|
||||||
--
|
--
|
||||||
-- 1.1) AIBALANCER construction method
|
-- 1.1) AIBALANCER construction method
|
||||||
@ -28,8 +28,8 @@
|
|||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- You can configure to have the AI to return to:
|
-- You can configure to have the AI to return to:
|
||||||
--
|
--
|
||||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Airbase#AIRBASE}.
|
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- --
|
-- --
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@ -73,8 +73,8 @@
|
|||||||
|
|
||||||
--- AIBALANCER class
|
--- AIBALANCER class
|
||||||
-- @type AIBALANCER
|
-- @type AIBALANCER
|
||||||
-- @field Set#SET_CLIENT SetClient
|
-- @field Core.Set#SET_CLIENT SetClient
|
||||||
-- @extends StateMachine#STATEMACHINE_SET
|
-- @extends Fsm.Fsm#FSM_SET
|
||||||
AIBALANCER = {
|
AIBALANCER = {
|
||||||
ClassName = "AIBALANCER",
|
ClassName = "AIBALANCER",
|
||||||
PatrolZones = {},
|
PatrolZones = {},
|
||||||
@ -83,8 +83,8 @@ AIBALANCER = {
|
|||||||
|
|
||||||
--- Creates a new AIBALANCER object
|
--- Creates a new AIBALANCER object
|
||||||
-- @param #AIBALANCER self
|
-- @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 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 Spawn#SPAWN SpawnAI The default Spawn object to spawn new AI Groups when needed.
|
-- @param Functional.Spawn#SPAWN SpawnAI The default Spawn object to spawn new AI Groups when needed.
|
||||||
-- @return #AIBALANCER
|
-- @return #AIBALANCER
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Define a new AIBALANCER Object.
|
-- -- Define a new AIBALANCER Object.
|
||||||
@ -104,7 +104,7 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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.SetClient = SetClient
|
||||||
self.SpawnAI = SpawnAI
|
self.SpawnAI = SpawnAI
|
||||||
@ -116,10 +116,10 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
--- Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- @param #AIBALANCER self
|
-- @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}.
|
||||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
-- @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 )
|
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||||
|
|
||||||
self.ToNearestAirbase = true
|
self.ToNearestAirbase = true
|
||||||
@ -127,9 +127,9 @@ function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseS
|
|||||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the AI to the home @{Airbase#AIRBASE}.
|
--- Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- @param #AIBALANCER self
|
-- @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 )
|
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||||
|
|
||||||
self.ToHomeAirbase = true
|
self.ToHomeAirbase = true
|
||||||
@ -137,9 +137,9 @@ function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AIBALANCER self
|
--- @param #AIBALANCER self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Core.Set#SET_GROUP SetGroup
|
||||||
-- @param #string ClientName
|
-- @param #string ClientName
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AIBALANCER:onenterSpawning( SetGroup, ClientName )
|
function AIBALANCER:onenterSpawning( SetGroup, ClientName )
|
||||||
|
|
||||||
-- OK, Spawn a new group from the default SpawnAI object provided.
|
-- OK, Spawn a new group from the default SpawnAI object provided.
|
||||||
@ -151,16 +151,16 @@ function AIBALANCER:onenterSpawning( SetGroup, ClientName )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AIBALANCER self
|
--- @param #AIBALANCER self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Core.Set#SET_GROUP SetGroup
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AIBALANCER:onenterDestroying( SetGroup, AIGroup )
|
function AIBALANCER:onenterDestroying( SetGroup, AIGroup )
|
||||||
|
|
||||||
AIGroup:Destroy()
|
AIGroup:Destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AIBALANCER self
|
--- @param #AIBALANCER self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Core.Set#SET_GROUP SetGroup
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function AIBALANCER:onenterReturning( SetGroup, AIGroup )
|
function AIBALANCER:onenterReturning( SetGroup, AIGroup )
|
||||||
|
|
||||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||||
@ -188,11 +188,11 @@ end
|
|||||||
function AIBALANCER:onenterMonitoring( SetGroup )
|
function AIBALANCER:onenterMonitoring( SetGroup )
|
||||||
|
|
||||||
self.SetClient:ForEachClient(
|
self.SetClient:ForEachClient(
|
||||||
--- @param Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
function( Client )
|
function( Client )
|
||||||
self:E(Client.ClientName)
|
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 Client:IsAlive() then
|
||||||
|
|
||||||
if AIGroup and AIGroup:IsAlive() == true then
|
if AIGroup and AIGroup:IsAlive() == true then
|
||||||
@ -210,7 +210,7 @@ function AIBALANCER:onenterMonitoring( SetGroup )
|
|||||||
self:E( RangeZone )
|
self:E( RangeZone )
|
||||||
|
|
||||||
_DATABASE:ForEachPlayer(
|
_DATABASE:ForEachPlayer(
|
||||||
--- @param Unit#UNIT RangeTestUnit
|
--- @param Wrapper.Unit#UNIT RangeTestUnit
|
||||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||||
@ -223,7 +223,7 @@ function AIBALANCER:onenterMonitoring( SetGroup )
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
--- @param Zone#ZONE_RADIUS RangeZone
|
--- @param Zone#ZONE_RADIUS RangeZone
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function( RangeZone, AIGroup, PlayerInRange )
|
function( RangeZone, AIGroup, PlayerInRange )
|
||||||
if PlayerInRange.Value == false then
|
if PlayerInRange.Value == false then
|
||||||
self:Return( AIGroup )
|
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:
|
-- CLIENTS should not be allowed to:
|
||||||
--
|
--
|
||||||
-- * Don't taxi faster than 40 km/h.
|
-- * Don't taxi faster than 40 km/h.
|
||||||
@ -12,7 +12,7 @@
|
|||||||
-- * Avoid to hit other planes on the airbase.
|
-- * Avoid to hit other planes on the airbase.
|
||||||
-- * Obey ground control orders.
|
-- * 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.
|
-- 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.
|
-- 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
|
-- * TbilisiLochini
|
||||||
-- * Vaziani
|
-- * 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.
|
-- 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.
|
-- 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
|
--- @type AIRBASEPOLICE_BASE
|
||||||
-- @field Set#SET_CLIENT SetClient
|
-- @field Core.Set#SET_CLIENT SetClient
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
AIRBASEPOLICE_BASE = {
|
AIRBASEPOLICE_BASE = {
|
||||||
ClassName = "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.Airbases.Template.ZoneRunways[1] = ZONE_POLYGON:New( "Template Runway 1", TemplateRunway1 ):SmokeZone(POINT_VEC3.SmokeColor.Red):Flush()
|
||||||
|
|
||||||
self.SetClient:ForEachClient(
|
self.SetClient:ForEachClient(
|
||||||
--- @param Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
function( Client )
|
function( Client )
|
||||||
Client:SetState( self, "Speeding", false )
|
Client:SetState( self, "Speeding", false )
|
||||||
Client:SetState( self, "Warnings", 0)
|
Client:SetState( self, "Warnings", 0)
|
||||||
@ -141,7 +141,7 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
|
|||||||
|
|
||||||
self.SetClient:ForEachClientInZone( Airbase.ZoneBoundary,
|
self.SetClient:ForEachClientInZone( Airbase.ZoneBoundary,
|
||||||
|
|
||||||
--- @param Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
function( Client )
|
function( Client )
|
||||||
|
|
||||||
self:E( Client.UnitName )
|
self:E( Client.UnitName )
|
||||||
@ -219,7 +219,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- @type AIRBASEPOLICE_CAUCASUS
|
--- @type AIRBASEPOLICE_CAUCASUS
|
||||||
-- @field Set#SET_CLIENT SetClient
|
-- @field Core.Set#SET_CLIENT SetClient
|
||||||
-- @extends #AIRBASEPOLICE_BASE
|
-- @extends #AIRBASEPOLICE_BASE
|
||||||
|
|
||||||
AIRBASEPOLICE_CAUCASUS = {
|
AIRBASEPOLICE_CAUCASUS = {
|
||||||
@ -960,7 +960,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- @type AIRBASEPOLICE_NEVADA
|
--- @type AIRBASEPOLICE_NEVADA
|
||||||
-- @extends AirbasePolice#AIRBASEPOLICE_BASE
|
-- @extends Functional.AirbasePolice#AIRBASEPOLICE_BASE
|
||||||
AIRBASEPOLICE_NEVADA = {
|
AIRBASEPOLICE_NEVADA = {
|
||||||
ClassName = "AIRBASEPOLICE_NEVADA",
|
ClassName = "AIRBASEPOLICE_NEVADA",
|
||||||
Airbases = {
|
Airbases = {
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
--- The CLEANUP class.
|
--- The CLEANUP class.
|
||||||
-- @type CLEANUP
|
-- @type CLEANUP
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
CLEANUP = {
|
CLEANUP = {
|
||||||
ClassName = "CLEANUP",
|
ClassName = "CLEANUP",
|
||||||
ZoneNames = {},
|
ZoneNames = {},
|
||||||
@ -51,7 +51,7 @@ end
|
|||||||
|
|
||||||
--- Destroys a group from the simulator, but checks first if it is still existing!
|
--- Destroys a group from the simulator, but checks first if it is still existing!
|
||||||
-- @param #CLEANUP self
|
-- @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...
|
-- @param #string CleanUpGroupName The groupname...
|
||||||
function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
||||||
self:F( { GroupObject, CleanUpGroupName } )
|
self:F( { GroupObject, CleanUpGroupName } )
|
||||||
@ -62,9 +62,9 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
|||||||
end
|
end
|
||||||
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 #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 ...
|
-- @param #string CleanUpUnitName The Unit name ...
|
||||||
function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName )
|
function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName )
|
||||||
self:F( { CleanUpUnit, CleanUpUnitName } )
|
self:F( { CleanUpUnit, CleanUpUnitName } )
|
||||||
@ -89,10 +89,10 @@ function CLEANUP:_DestroyUnit( CleanUpUnit, CleanUpUnitName )
|
|||||||
end
|
end
|
||||||
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!
|
--- Destroys a missile from the simulator, but checks first if it is still existing!
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param DCSTypes#Weapon MissileObject
|
-- @param Dcs.DCSTypes#Weapon MissileObject
|
||||||
function CLEANUP:_DestroyMissile( MissileObject )
|
function CLEANUP:_DestroyMissile( MissileObject )
|
||||||
self:F( { MissileObject } )
|
self:F( { MissileObject } )
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ end
|
|||||||
--- Detects if a crash event occurs.
|
--- Detects if a crash event occurs.
|
||||||
-- Crashed units go into a CleanUpList for removal.
|
-- Crashed units go into a CleanUpList for removal.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param DCSTypes#Event event
|
-- @param Dcs.DCSTypes#Event event
|
||||||
function CLEANUP:_EventCrash( Event )
|
function CLEANUP:_EventCrash( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ end
|
|||||||
--- Detects if a unit shoots a missile.
|
--- Detects if a unit shoots a missile.
|
||||||
-- If this occurs within one of the zones, then the weapon used must be destroyed.
|
-- If this occurs within one of the zones, then the weapon used must be destroyed.
|
||||||
-- @param #CLEANUP self
|
-- @param #CLEANUP self
|
||||||
-- @param DCSTypes#Event event
|
-- @param Dcs.DCSTypes#Event event
|
||||||
function CLEANUP:_EventShot( Event )
|
function CLEANUP:_EventShot( Event )
|
||||||
self:F( { 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.
|
--- 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 #CLEANUP self
|
||||||
-- @param DCSTypes#Event event
|
-- @param Dcs.DCSTypes#Event event
|
||||||
function CLEANUP:_EventHitCleanUp( Event )
|
function CLEANUP:_EventHitCleanUp( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ function CLEANUP:_EventHitCleanUp( Event )
|
|||||||
end
|
end
|
||||||
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 )
|
function CLEANUP:_AddForCleanUp( CleanUpUnit, CleanUpUnitName )
|
||||||
self:F( { 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.
|
--- 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 #CLEANUP self
|
||||||
-- @param DCSTypes#Event event
|
-- @param Dcs.DCSTypes#Event event
|
||||||
function CLEANUP:_EventAddForCleanUp( Event )
|
function CLEANUP:_EventAddForCleanUp( Event )
|
||||||
|
|
||||||
if Event.IniDCSUnit then
|
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 @{Functional.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 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
|
-- 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
|
-- 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:
|
-- 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.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||||
-- * @{Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||||
-- * @{Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||||
-- * @{Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||||
-- * @{Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||||
-- * @{Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
-- * @{Functional.Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||||
--
|
--
|
||||||
-- 1.3) Obtain objects detected by DETECTION_BASE
|
-- 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}().
|
-- 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 @{Set#SET_BASE} objects.
|
-- 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),
|
-- 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 @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
-- 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.
|
-- 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.
|
-- 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
|
-- 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.
|
-- 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 @{Detection#DETECTION_BASE.GetDetectedSetCount}().
|
-- 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 @{Detection#DETECTION_BASE.GetDetectedSet}() with a given index.
|
-- 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}().
|
-- 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 @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
-- 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 @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
-- 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
|
-- 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
|
-- 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
|
--- DETECTION_BASE class
|
||||||
-- @type DETECTION_BASE
|
-- @type DETECTION_BASE
|
||||||
-- @field Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
-- @field Core.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 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 #DETECTION_BASE.DetectedObjects DetectedObjects The list of detected objects.
|
||||||
-- @field #table DetectedObjectsIdentified Map of the DetectedObjects identified.
|
-- @field #table DetectedObjectsIdentified Map of the DetectedObjects identified.
|
||||||
-- @field #number DetectionRun
|
-- @field #number DetectionRun
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
DETECTION_BASE = {
|
DETECTION_BASE = {
|
||||||
ClassName = "DETECTION_BASE",
|
ClassName = "DETECTION_BASE",
|
||||||
DetectionSetGroup = nil,
|
DetectionSetGroup = nil,
|
||||||
@ -104,8 +104,8 @@ DETECTION_BASE = {
|
|||||||
|
|
||||||
--- DETECTION constructor.
|
--- DETECTION constructor.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
-- @param Core.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 Dcs.DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||||
-- @return #DETECTION_BASE self
|
-- @return #DETECTION_BASE self
|
||||||
function DETECTION_BASE:New( DetectionSetGroup, DetectionRange )
|
function DETECTION_BASE:New( DetectionSetGroup, DetectionRange )
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ function DETECTION_BASE:GetDetectedObject( ObjectName )
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the detected @{Set#SET_BASE}s.
|
--- Get the detected @{Core.Set#SET_BASE}s.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @return #DETECTION_BASE.DetectedSets DetectedSets
|
-- @return #DETECTION_BASE.DetectedSets DetectedSets
|
||||||
function DETECTION_BASE:GetDetectedSets()
|
function DETECTION_BASE:GetDetectedSets()
|
||||||
@ -266,7 +266,7 @@ end
|
|||||||
--- Get a SET of detected objects using a given numeric index.
|
--- Get a SET of detected objects using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #number Index
|
||||||
-- @return Set#SET_BASE
|
-- @return Core.Set#SET_BASE
|
||||||
function DETECTION_BASE:GetDetectedSet( Index )
|
function DETECTION_BASE:GetDetectedSet( Index )
|
||||||
|
|
||||||
local DetectionSet = self.DetectedSets[Index]
|
local DetectionSet = self.DetectedSets[Index]
|
||||||
@ -279,7 +279,7 @@ end
|
|||||||
|
|
||||||
--- Get the detection Groups.
|
--- Get the detection Groups.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @return Group#GROUP
|
-- @return Wrapper.Group#GROUP
|
||||||
function DETECTION_BASE:GetDetectionSetGroup()
|
function DETECTION_BASE:GetDetectionSetGroup()
|
||||||
|
|
||||||
local DetectionSetGroup = self.DetectionSetGroup
|
local DetectionSetGroup = self.DetectionSetGroup
|
||||||
@ -313,7 +313,7 @@ function DETECTION_BASE:Schedule( DelayTime, RepeatInterval )
|
|||||||
end
|
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
|
-- @param #DETECTION_BASE self
|
||||||
function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||||
self:F2( { SchedulerName } )
|
self:F2( { SchedulerName } )
|
||||||
@ -323,7 +323,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
|||||||
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
|
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
|
||||||
|
|
||||||
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||||
local DetectionGroup = DetectionGroupData -- Group#GROUP
|
local DetectionGroup = DetectionGroupData -- Wrapper.Group#GROUP
|
||||||
|
|
||||||
if DetectionGroup:IsAlive() then
|
if DetectionGroup:IsAlive() then
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
|||||||
)
|
)
|
||||||
|
|
||||||
for DetectionDetectedTargetID, DetectionDetectedTarget in pairs( DetectionDetectedTargets ) do
|
for DetectionDetectedTargetID, DetectionDetectedTarget in pairs( DetectionDetectedTargets ) do
|
||||||
local DetectionObject = DetectionDetectedTarget.object -- DCSObject#Object
|
local DetectionObject = DetectionDetectedTarget.object -- Dcs.DCSWrapper.Object#Object
|
||||||
self:T2( DetectionObject )
|
self:T2( DetectionObject )
|
||||||
|
|
||||||
if DetectionObject and DetectionObject:isExist() and DetectionObject.id_ < 50000000 then
|
if DetectionObject and DetectionObject:isExist() and DetectionObject.id_ < 50000000 then
|
||||||
@ -393,9 +393,9 @@ end
|
|||||||
|
|
||||||
--- DETECTION_AREAS class
|
--- DETECTION_AREAS class
|
||||||
-- @type DETECTION_AREAS
|
-- @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.
|
-- @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 = {
|
DETECTION_AREAS = {
|
||||||
ClassName = "DETECTION_AREAS",
|
ClassName = "DETECTION_AREAS",
|
||||||
DetectedAreas = { n = 0 },
|
DetectedAreas = { n = 0 },
|
||||||
@ -406,21 +406,21 @@ DETECTION_AREAS = {
|
|||||||
-- @list <#DETECTION_AREAS.DetectedArea>
|
-- @list <#DETECTION_AREAS.DetectedArea>
|
||||||
|
|
||||||
--- @type DETECTION_AREAS.DetectedArea
|
--- @type DETECTION_AREAS.DetectedArea
|
||||||
-- @field Set#SET_UNIT Set -- The Set of Units in the detected area.
|
-- @field Core.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.Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||||
-- @field #boolean Changed Documents if the detected area has changes.
|
-- @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 #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 #number AreaID -- The identifier of the detected area.
|
||||||
-- @field #boolean FriendliesNearBy Indicates if there are friendlies within 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.
|
--- DETECTION_AREAS constructor.
|
||||||
-- @param Detection#DETECTION_AREAS self
|
-- @param Functional.Detection#DETECTION_AREAS self
|
||||||
-- @param Set#SET_GROUP DetectionSetGroup The @{Set} of GROUPs in the Forward Air Controller role.
|
-- @param Core.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 Dcs.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.
|
-- @param Dcs.DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||||
-- @return Detection#DETECTION_AREAS self
|
-- @return Functional.Detection#DETECTION_AREAS self
|
||||||
function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRange )
|
function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRange )
|
||||||
|
|
||||||
-- Inherits from DETECTION_BASE
|
-- Inherits from DETECTION_BASE
|
||||||
@ -439,8 +439,8 @@ function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRa
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Add a detected @{#DETECTION_AREAS.DetectedArea}.
|
--- Add a detected @{#DETECTION_AREAS.DetectedArea}.
|
||||||
-- @param Set#SET_UNIT Set -- The Set of Units in the detected area.
|
-- @param Core.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.Zone#ZONE_UNIT Zone -- The Zone of the detected area.
|
||||||
-- @return #DETECTION_AREAS.DetectedArea DetectedArea
|
-- @return #DETECTION_AREAS.DetectedArea DetectedArea
|
||||||
function DETECTION_AREAS:AddDetectedArea( Set, Zone )
|
function DETECTION_AREAS:AddDetectedArea( Set, Zone )
|
||||||
local DetectedAreas = self:GetDetectedAreas()
|
local DetectedAreas = self:GetDetectedAreas()
|
||||||
@ -487,10 +487,10 @@ function DETECTION_AREAS:GetDetectedAreaCount()
|
|||||||
return DetectedAreaCount
|
return DetectedAreaCount
|
||||||
end
|
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 #DETECTION_AREAS self
|
||||||
-- @param #number Index
|
-- @param #number Index
|
||||||
-- @return Set#SET_UNIT DetectedSet
|
-- @return Core.Set#SET_UNIT DetectedSet
|
||||||
function DETECTION_AREAS:GetDetectedSet( Index )
|
function DETECTION_AREAS:GetDetectedSet( Index )
|
||||||
|
|
||||||
local DetectedSetUnit = self.DetectedAreas[Index].Set
|
local DetectedSetUnit = self.DetectedAreas[Index].Set
|
||||||
@ -501,10 +501,10 @@ function DETECTION_AREAS:GetDetectedSet( Index )
|
|||||||
return nil
|
return nil
|
||||||
end
|
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 #DETECTION_AREAS self
|
||||||
-- @param #number Index
|
-- @param #number Index
|
||||||
-- @return Zone#ZONE_UNIT DetectedZone
|
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
||||||
function DETECTION_AREAS:GetDetectedZone( Index )
|
function DETECTION_AREAS:GetDetectedZone( Index )
|
||||||
|
|
||||||
local DetectedZone = self.DetectedAreas[Index].Zone
|
local DetectedZone = self.DetectedAreas[Index].Zone
|
||||||
@ -517,11 +517,11 @@ end
|
|||||||
|
|
||||||
--- Background worker function to determine if there are friendlies nearby ...
|
--- Background worker function to determine if there are friendlies nearby ...
|
||||||
-- @param #DETECTION_AREAS self
|
-- @param #DETECTION_AREAS self
|
||||||
-- @param Unit#UNIT ReportUnit
|
-- @param Wrapper.Unit#UNIT ReportUnit
|
||||||
function DETECTION_AREAS:ReportFriendliesNearBy( ReportGroupData )
|
function DETECTION_AREAS:ReportFriendliesNearBy( ReportGroupData )
|
||||||
self:F2()
|
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 DetectedSet = ReportGroupData.DetectedArea.Set
|
||||||
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
||||||
local DetectedZoneUnit = DetectedZone.ZoneUNIT
|
local DetectedZoneUnit = DetectedZone.ZoneUNIT
|
||||||
@ -537,15 +537,15 @@ function DETECTION_AREAS:ReportFriendliesNearBy( ReportGroupData )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @param DCSUnit#Unit FoundDCSUnit
|
--- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit
|
||||||
-- @param Group#GROUP ReportGroup
|
-- @param Wrapper.Group#GROUP ReportGroup
|
||||||
-- @param Set#SET_GROUP ReportSetGroup
|
-- @param Set#SET_GROUP ReportSetGroup
|
||||||
local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData )
|
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 DetectedSet = ReportGroupData.DetectedArea.Set
|
||||||
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
local DetectedZone = ReportGroupData.DetectedArea.Zone
|
||||||
local DetectedZoneUnit = DetectedZone.ZoneUNIT -- Unit#UNIT
|
local DetectedZoneUnit = DetectedZone.ZoneUNIT -- Wrapper.Unit#UNIT
|
||||||
local ReportSetGroup = ReportGroupData.ReportSetGroup
|
local ReportSetGroup = ReportGroupData.ReportSetGroup
|
||||||
|
|
||||||
local EnemyCoalition = DetectedZoneUnit:GetCoalition()
|
local EnemyCoalition = DetectedZoneUnit:GetCoalition()
|
||||||
@ -588,7 +588,7 @@ function DETECTION_AREAS:CalculateThreatLevelA2G( DetectedArea )
|
|||||||
|
|
||||||
local MaxThreatLevelA2G = 0
|
local MaxThreatLevelA2G = 0
|
||||||
for UnitName, UnitData in pairs( DetectedArea.Set:GetSet() ) do
|
for UnitName, UnitData in pairs( DetectedArea.Set:GetSet() ) do
|
||||||
local ThreatUnit = UnitData -- Unit#UNIT
|
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local ThreatLevelA2G = ThreatUnit:GetThreatLevel()
|
local ThreatLevelA2G = ThreatUnit:GetThreatLevel()
|
||||||
if ThreatLevelA2G > MaxThreatLevelA2G then
|
if ThreatLevelA2G > MaxThreatLevelA2G then
|
||||||
MaxThreatLevelA2G = ThreatLevelA2G
|
MaxThreatLevelA2G = ThreatLevelA2G
|
||||||
@ -603,7 +603,7 @@ end
|
|||||||
--- Find the nearest FAC of the DetectedArea.
|
--- Find the nearest FAC of the DetectedArea.
|
||||||
-- @param #DETECTION_AREAS self
|
-- @param #DETECTION_AREAS self
|
||||||
-- @param #DETECTION_AREAS.DetectedArea DetectedArea
|
-- @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 )
|
function DETECTION_AREAS:NearestFAC( DetectedArea )
|
||||||
|
|
||||||
local NearestFAC = nil
|
local NearestFAC = nil
|
||||||
@ -611,7 +611,7 @@ function DETECTION_AREAS:NearestFAC( DetectedArea )
|
|||||||
|
|
||||||
for FACGroupName, FACGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
for FACGroupName, FACGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||||
for FACUnit, FACUnitData in pairs( FACGroupData:GetUnits() ) do
|
for FACUnit, FACUnitData in pairs( FACGroupData:GetUnits() ) do
|
||||||
local FACUnit = FACUnitData -- Unit#UNIT
|
local FACUnit = FACUnitData -- Wrapper.Unit#UNIT
|
||||||
if FACUnit:IsActive() then
|
if FACUnit:IsActive() then
|
||||||
local Vec3 = FACUnit:GetVec3()
|
local Vec3 = FACUnit:GetVec3()
|
||||||
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
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.
|
-- 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
|
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 )
|
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.
|
-- 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.
|
-- 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
|
for DetectedUnitName, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
||||||
|
|
||||||
local DetectedUnit = DetectedUnitData -- Unit#UNIT
|
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||||
local DetectedObject = nil
|
local DetectedObject = nil
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
--self:E(DetectedUnit:GetName())
|
--self:E(DetectedUnit:GetName())
|
||||||
@ -909,7 +909,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
|||||||
if DetectedObject then
|
if DetectedObject then
|
||||||
|
|
||||||
-- We found an unidentified unit outside of any existing detection area.
|
-- 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
|
local AddedToDetectionArea = false
|
||||||
|
|
||||||
@ -959,7 +959,7 @@ function DETECTION_AREAS:CreateDetectionSets()
|
|||||||
DetectedZone.ZoneUNIT:SmokeRed()
|
DetectedZone.ZoneUNIT:SmokeRed()
|
||||||
end
|
end
|
||||||
DetectedSet:ForEachUnit(
|
DetectedSet:ForEachUnit(
|
||||||
--- @param Unit#UNIT DetectedUnit
|
--- @param Wrapper.Unit#UNIT DetectedUnit
|
||||||
function( DetectedUnit )
|
function( DetectedUnit )
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
self:T( "Detected Set #" .. DetectedArea.AreaID .. ":" .. DetectedUnit:GetName() )
|
self:T( "Detected Set #" .. DetectedArea.AreaID .. ":" .. DetectedUnit:GetName() )
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
-- ============================
|
-- ============================
|
||||||
-- Create a new SPAWN object with the @{#ESCORT.New} method:
|
-- 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.
|
-- ESCORT initialization methods.
|
||||||
-- ==============================
|
-- ==============================
|
||||||
@ -117,17 +117,17 @@
|
|||||||
|
|
||||||
--- ESCORT class
|
--- ESCORT class
|
||||||
-- @type ESCORT
|
-- @type ESCORT
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
-- @field Client#CLIENT EscortClient
|
-- @field Wrapper.Client#CLIENT EscortClient
|
||||||
-- @field Group#GROUP EscortGroup
|
-- @field Wrapper.Group#GROUP EscortGroup
|
||||||
-- @field #string EscortName
|
-- @field #string EscortName
|
||||||
-- @field #ESCORT.MODE EscortMode The mode the escort is in.
|
-- @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 #number FollowDistance The current follow distance.
|
||||||
-- @field #boolean ReportTargets If true, nearby targets are reported.
|
-- @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 Dcs.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 Dcs.DCSTypes#AI.Option.Air.val.REACTION_ON_THREAT OptionReactionOnThreat Which REACTION_ON_THREAT is set to the EscortGroup.
|
||||||
-- @field Menu#MENU_CLIENT EscortMenuResumeMission
|
-- @field Core.Menu#MENU_CLIENT EscortMenuResumeMission
|
||||||
ESCORT = {
|
ESCORT = {
|
||||||
ClassName = "ESCORT",
|
ClassName = "ESCORT",
|
||||||
EscortName = nil, -- The Escort Name
|
EscortName = nil, -- The Escort Name
|
||||||
@ -161,8 +161,8 @@ ESCORT = {
|
|||||||
|
|
||||||
--- ESCORT class constructor for an AI group
|
--- ESCORT class constructor for an AI group
|
||||||
-- @param #ESCORT self
|
-- @param #ESCORT self
|
||||||
-- @param Client#CLIENT EscortClient The client escorted by the EscortGroup.
|
-- @param Wrapper.Client#CLIENT EscortClient The client escorted by the EscortGroup.
|
||||||
-- @param Group#GROUP EscortGroup The group AI escorting the EscortClient.
|
-- @param Wrapper.Group#GROUP EscortGroup The group AI escorting the EscortClient.
|
||||||
-- @param #string EscortName Name of the escort.
|
-- @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.
|
-- @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
|
-- @return #ESCORT self
|
||||||
@ -179,8 +179,8 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing )
|
|||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:F( { EscortClient, EscortGroup, EscortName } )
|
self:F( { EscortClient, EscortGroup, EscortName } )
|
||||||
|
|
||||||
self.EscortClient = EscortClient -- Client#CLIENT
|
self.EscortClient = EscortClient -- Wrapper.Client#CLIENT
|
||||||
self.EscortGroup = EscortGroup -- Group#GROUP
|
self.EscortGroup = EscortGroup -- Wrapper.Group#GROUP
|
||||||
self.EscortName = EscortName
|
self.EscortName = EscortName
|
||||||
self.EscortBriefing = EscortBriefing
|
self.EscortBriefing = EscortBriefing
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ end
|
|||||||
--- Defines a menu slot to let the escort Join and Follow you at a certain distance.
|
--- Defines a menu slot to let the escort Join and Follow you at a certain distance.
|
||||||
-- This menu will appear under **Navigation**.
|
-- This menu will appear under **Navigation**.
|
||||||
-- @param #ESCORT self
|
-- @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
|
-- @return #ESCORT
|
||||||
function ESCORT:MenuFollowAt( Distance )
|
function ESCORT:MenuFollowAt( Distance )
|
||||||
self:F(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.
|
--- 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**.
|
-- This menu will appear under **Hold position**.
|
||||||
-- @param #ESCORT self
|
-- @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 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 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#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.
|
-- @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
|
-- @return #ESCORT
|
||||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
-- 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.
|
--- 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**.
|
-- This menu will appear under **Navigation**.
|
||||||
-- @param #ESCORT self
|
-- @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 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 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#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.
|
-- @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
|
-- @return #ESCORT
|
||||||
-- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.
|
-- 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.
|
--- 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**.
|
-- This menu will appear under **Scan targets**.
|
||||||
-- @param #ESCORT self
|
-- @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 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 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#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.
|
-- @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
|
-- @return #ESCORT
|
||||||
function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat )
|
function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat )
|
||||||
@ -542,7 +542,7 @@ end
|
|||||||
-- This menu will appear under **Report targets**.
|
-- 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.
|
-- 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 #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
|
-- @return #ESCORT
|
||||||
function ESCORT:MenuReportTargets( Seconds )
|
function ESCORT:MenuReportTargets( Seconds )
|
||||||
self:F( { Seconds } )
|
self:F( { Seconds } )
|
||||||
@ -664,8 +664,8 @@ function ESCORT._HoldPosition( MenuParam )
|
|||||||
local EscortGroup = self.EscortGroup
|
local EscortGroup = self.EscortGroup
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
|
|
||||||
local OrbitGroup = MenuParam.ParamOrbitGroup -- Group#GROUP
|
local OrbitGroup = MenuParam.ParamOrbitGroup -- Wrapper.Group#GROUP
|
||||||
local OrbitUnit = OrbitGroup:GetUnit(1) -- Unit#UNIT
|
local OrbitUnit = OrbitGroup:GetUnit(1) -- Wrapper.Unit#UNIT
|
||||||
local OrbitHeight = MenuParam.ParamHeight
|
local OrbitHeight = MenuParam.ParamHeight
|
||||||
local OrbitSeconds = MenuParam.ParamSeconds -- Not implemented yet
|
local OrbitSeconds = MenuParam.ParamSeconds -- Not implemented yet
|
||||||
|
|
||||||
@ -714,10 +714,10 @@ function ESCORT._JoinUpAndFollow( MenuParam )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- JoinsUp and Follows a CLIENT.
|
--- JoinsUp and Follows a CLIENT.
|
||||||
-- @param Escort#ESCORT self
|
-- @param Functional.Escort#ESCORT self
|
||||||
-- @param Group#GROUP EscortGroup
|
-- @param Wrapper.Group#GROUP EscortGroup
|
||||||
-- @param Client#CLIENT EscortClient
|
-- @param Wrapper.Client#CLIENT EscortClient
|
||||||
-- @param DCSTypes#Distance Distance
|
-- @param Dcs.DCSTypes#Distance Distance
|
||||||
function ESCORT:JoinUpAndFollow( EscortGroup, EscortClient, Distance )
|
function ESCORT:JoinUpAndFollow( EscortGroup, EscortClient, Distance )
|
||||||
self:F( { EscortGroup, EscortClient, Distance } )
|
self:F( { EscortGroup, EscortClient, Distance } )
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ function ESCORT._ScanTargets( MenuParam )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Group#GROUP EscortGroup
|
--- @param Wrapper.Group#GROUP EscortGroup
|
||||||
function _Resume( EscortGroup )
|
function _Resume( EscortGroup )
|
||||||
env.info( '_Resume' )
|
env.info( '_Resume' )
|
||||||
|
|
||||||
@ -851,7 +851,7 @@ function ESCORT._AttackTarget( MenuParam )
|
|||||||
local EscortGroup = self.EscortGroup
|
local EscortGroup = self.EscortGroup
|
||||||
|
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
local AttackUnit = MenuParam.ParamUnit -- Unit#UNIT
|
local AttackUnit = MenuParam.ParamUnit -- Wrapper.Unit#UNIT
|
||||||
|
|
||||||
self.FollowScheduler:Stop()
|
self.FollowScheduler:Stop()
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ function ESCORT._AssistTarget( MenuParam )
|
|||||||
local EscortGroup = self.EscortGroup
|
local EscortGroup = self.EscortGroup
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
local EscortGroupAttack = MenuParam.ParamEscortGroup
|
local EscortGroupAttack = MenuParam.ParamEscortGroup
|
||||||
local AttackUnit = MenuParam.ParamUnit -- Unit#UNIT
|
local AttackUnit = MenuParam.ParamUnit -- Wrapper.Unit#UNIT
|
||||||
|
|
||||||
self.FollowScheduler:Stop()
|
self.FollowScheduler:Stop()
|
||||||
|
|
||||||
@ -981,7 +981,7 @@ end
|
|||||||
function ESCORT:RegisterRoute()
|
function ESCORT:RegisterRoute()
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
local EscortGroup = self.EscortGroup -- Group#GROUP
|
local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP
|
||||||
|
|
||||||
local TaskPoints = EscortGroup:GetTaskRoute()
|
local TaskPoints = EscortGroup:GetTaskRoute()
|
||||||
|
|
||||||
@ -990,7 +990,7 @@ function ESCORT:RegisterRoute()
|
|||||||
return TaskPoints
|
return TaskPoints
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Escort#ESCORT self
|
--- @param Functional.Escort#ESCORT self
|
||||||
function ESCORT:_FollowScheduler()
|
function ESCORT:_FollowScheduler()
|
||||||
self:F( { self.FollowDistance } )
|
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 @{#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.
|
-- the class will destroy the missile within a certain range, to avoid damage to your aircraft.
|
||||||
@ -83,8 +83,8 @@
|
|||||||
|
|
||||||
--- The MISSILETRAINER class
|
--- The MISSILETRAINER class
|
||||||
-- @type MISSILETRAINER
|
-- @type MISSILETRAINER
|
||||||
-- @field Set#SET_CLIENT DBClients
|
-- @field Core.Set#SET_CLIENT DBClients
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
MISSILETRAINER = {
|
MISSILETRAINER = {
|
||||||
ClassName = "MISSILETRAINER",
|
ClassName = "MISSILETRAINER",
|
||||||
TrackingMissiles = {},
|
TrackingMissiles = {},
|
||||||
@ -191,7 +191,7 @@ function MISSILETRAINER:New( Distance, Briefing )
|
|||||||
|
|
||||||
|
|
||||||
-- self.DB:ForEachClient(
|
-- self.DB:ForEachClient(
|
||||||
-- --- @param Client#CLIENT Client
|
-- --- @param Wrapper.Client#CLIENT Client
|
||||||
-- function( Client )
|
-- function( Client )
|
||||||
--
|
--
|
||||||
-- ... actions ...
|
-- ... 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.
|
--- 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 #MISSILETRAINER self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function MISSILETRAINER:_EventShot( Event )
|
function MISSILETRAINER:_EventShot( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
--- The Scoring class
|
--- The Scoring class
|
||||||
-- @type SCORING
|
-- @type SCORING
|
||||||
-- @field Players A collection of the current players that have joined the game.
|
-- @field Players A collection of the current players that have joined the game.
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
SCORING = {
|
SCORING = {
|
||||||
ClassName = "SCORING",
|
ClassName = "SCORING",
|
||||||
ClassID = 0,
|
ClassID = 0,
|
||||||
@ -100,7 +100,7 @@ end
|
|||||||
|
|
||||||
--- Track DEAD or CRASH events for the scoring.
|
--- Track DEAD or CRASH events for the scoring.
|
||||||
-- @param #SCORING self
|
-- @param #SCORING self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SCORING:_EventOnDeadOrCrash( Event )
|
function SCORING:_EventOnDeadOrCrash( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
@ -265,8 +265,8 @@ end
|
|||||||
|
|
||||||
--- Registers Scores the players completing a Mission Task.
|
--- Registers Scores the players completing a Mission Task.
|
||||||
-- @param #SCORING self
|
-- @param #SCORING self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Unit#UNIT PlayerUnit
|
-- @param Wrapper.Unit#UNIT PlayerUnit
|
||||||
-- @param #string Text
|
-- @param #string Text
|
||||||
-- @param #number Score
|
-- @param #number Score
|
||||||
function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, 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.
|
--- Registers Mission Scores for possible multiple players that contributed in the Mission.
|
||||||
-- @param #SCORING self
|
-- @param #SCORING self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Unit#UNIT PlayerUnit
|
-- @param Wrapper.Unit#UNIT PlayerUnit
|
||||||
-- @param #string Text
|
-- @param #string Text
|
||||||
-- @param #number Score
|
-- @param #number Score
|
||||||
function SCORING:_AddMissionScore( Mission, Text, Score )
|
function SCORING:_AddMissionScore( Mission, Text, Score )
|
||||||
@ -330,7 +330,7 @@ end
|
|||||||
|
|
||||||
--- Handles the OnHit event for the scoring.
|
--- Handles the OnHit event for the scoring.
|
||||||
-- @param #SCORING self
|
-- @param #SCORING self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SCORING:_EventOnHit( Event )
|
function SCORING:_EventOnHit( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
--- The SEAD class
|
--- The SEAD class
|
||||||
-- @type SEAD
|
-- @type SEAD
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
SEAD = {
|
SEAD = {
|
||||||
ClassName = "SEAD",
|
ClassName = "SEAD",
|
||||||
TargetSkill = {
|
TargetSkill = {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
--- This module contains the SPAWN class.
|
--- 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.
|
-- 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.
|
-- 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
|
--- SPAWN Class
|
||||||
-- @type SPAWN
|
-- @type SPAWN
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
-- @field ClassName
|
-- @field ClassName
|
||||||
-- @field #string SpawnTemplatePrefix
|
-- @field #string SpawnTemplatePrefix
|
||||||
-- @field #string SpawnAliasPrefix
|
-- @field #string SpawnAliasPrefix
|
||||||
@ -211,7 +211,7 @@ SPAWN = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
--- @type SPAWN.SpawnZoneTable
|
--- @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.
|
--- 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.
|
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
|
||||||
-- @param #SPAWN self
|
-- @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 #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 Dcs.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 InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||||
-- @return #SPAWN
|
-- @return #SPAWN
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- NATO helicopters engaging in the battle field.
|
-- -- NATO helicopters engaging in the battle field.
|
||||||
@ -572,7 +572,7 @@ end
|
|||||||
--- Will spawn a group based on the internal index.
|
--- Will spawn a group based on the internal index.
|
||||||
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
||||||
-- @param #SPAWN self
|
-- @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()
|
function SPAWN:Spawn()
|
||||||
self:F( { self.SpawnTemplatePrefix, self.SpawnIndex, self.AliveUnits } )
|
self:F( { self.SpawnTemplatePrefix, self.SpawnIndex, self.AliveUnits } )
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ end
|
|||||||
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
||||||
-- @param #SPAWN self
|
-- @param #SPAWN self
|
||||||
-- @param #string SpawnIndex The index of the group to be spawned.
|
-- @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 )
|
function SPAWN:ReSpawn( SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, SpawnIndex } )
|
self:F( { self.SpawnTemplatePrefix, SpawnIndex } )
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ end
|
|||||||
-- Uses @{DATABASE} global object defined in MOOSE.
|
-- Uses @{DATABASE} global object defined in MOOSE.
|
||||||
-- @param #SPAWN self
|
-- @param #SPAWN self
|
||||||
-- @param #string SpawnIndex The index of the group to be spawned.
|
-- @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 )
|
function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||||
self:F2( { SpawnTemplatePrefix = self.SpawnTemplatePrefix, SpawnIndex = SpawnIndex, AliveUnits = self.AliveUnits, SpawnMaxGroups = self.SpawnMaxGroups } )
|
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.
|
--- 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 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 #SPAWN self
|
||||||
-- @param #function SpawnCallBackFunction The function to be called when a group spawns.
|
-- @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.
|
-- @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.
|
-- 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.
|
-- You can use the returned group to further define the route to be followed.
|
||||||
-- @param #SPAWN self
|
-- @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.
|
-- @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.
|
-- @return #nil Nothing was spawned.
|
||||||
function SPAWN:SpawnFromVec3( Vec3, SpawnIndex )
|
function SPAWN:SpawnFromVec3( Vec3, SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, 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.
|
-- 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.
|
-- You can use the returned group to further define the route to be followed.
|
||||||
-- @param #SPAWN self
|
-- @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.
|
-- @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.
|
-- @return #nil Nothing was spawned.
|
||||||
function SPAWN:SpawnFromVec2( Vec2, SpawnIndex )
|
function SPAWN:SpawnFromVec2( Vec2, SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, 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.
|
-- 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.
|
-- You can use the returned group to further define the route to be followed.
|
||||||
-- @param #SPAWN self
|
-- @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.
|
-- @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.
|
-- @return #nil Nothing was spawned.
|
||||||
function SPAWN:SpawnFromUnit( HostUnit, SpawnIndex )
|
function SPAWN:SpawnFromUnit( HostUnit, SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, 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).
|
--- 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.
|
-- You can use the returned group to further define the route to be followed.
|
||||||
-- @param #SPAWN self
|
-- @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.
|
-- @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.
|
-- @return #nil Nothing was spawned.
|
||||||
function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, HostStatic, SpawnIndex } )
|
self:F( { self.SpawnTemplatePrefix, HostStatic, SpawnIndex } )
|
||||||
@ -854,14 +854,14 @@ function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Will spawn a Group within a given @{Zone}.
|
--- 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.
|
-- 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.
|
-- The **first waypoint** (where the group is spawned) is replaced with the zone location coordinates.
|
||||||
-- @param #SPAWN self
|
-- @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 #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.
|
-- @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.
|
-- @return #nil when nothing was spawned.
|
||||||
function SPAWN:SpawnInZone( Zone, RandomizeGroup, SpawnIndex )
|
function SPAWN:SpawnInZone( Zone, RandomizeGroup, SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, 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.
|
--- 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
|
-- @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.
|
-- @return #nil, #nil When no group is found, #nil is returned.
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
-- -- 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.
|
--- 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 #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.
|
-- @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.
|
-- @return #nil, #nil When no alive @{Group} object is found from the start Index position, #nil is returned.
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
-- -- 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.
|
--- 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
|
-- @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.
|
-- @return #nil, #nil When no alive @{Group} object is found, #nil is returned.
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Find the last alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
|
-- -- 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.
|
-- If no index is given, it will return the first group in the list.
|
||||||
-- @param #SPAWN self
|
-- @param #SPAWN self
|
||||||
-- @param #number SpawnIndex The index of the group to return.
|
-- @param #number SpawnIndex The index of the group to return.
|
||||||
-- @return Group#GROUP self
|
-- @return Wrapper.Group#GROUP self
|
||||||
function SPAWN:GetGroupFromIndex( SpawnIndex )
|
function SPAWN:GetGroupFromIndex( SpawnIndex )
|
||||||
self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, 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.
|
-- 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.
|
-- It will return nil of no prefix was found.
|
||||||
-- @param #SPAWN self
|
-- @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 #string The prefix
|
||||||
-- @return #nil Nothing found
|
-- @return #nil Nothing found
|
||||||
function SPAWN:_GetGroupIndexFromDCSUnit( DCSUnit )
|
function SPAWN:_GetGroupIndexFromDCSUnit( DCSUnit )
|
||||||
@ -1044,7 +1044,7 @@ end
|
|||||||
-- The method will search for a #-mark, and will return the text before the #-mark.
|
-- The method will search for a #-mark, and will return the text before the #-mark.
|
||||||
-- It will return nil of no prefix was found.
|
-- It will return nil of no prefix was found.
|
||||||
-- @param #SPAWN self
|
-- @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 #string The prefix
|
||||||
-- @return #nil Nothing found
|
-- @return #nil Nothing found
|
||||||
function SPAWN:_GetPrefixFromDCSUnit( DCSUnit )
|
function SPAWN:_GetPrefixFromDCSUnit( DCSUnit )
|
||||||
@ -1064,8 +1064,8 @@ end
|
|||||||
|
|
||||||
--- Return the group within the SpawnGroups collection with input a DCSUnit.
|
--- Return the group within the SpawnGroups collection with input a DCSUnit.
|
||||||
-- @param #SPAWN self
|
-- @param #SPAWN self
|
||||||
-- @param DCSUnit#Unit DCSUnit The @{DCSUnit} to be searched.
|
-- @param Dcs.DCSWrapper.Unit#Unit DCSUnit The @{DCSUnit} to be searched.
|
||||||
-- @return Group#GROUP The Group
|
-- @return Wrapper.Group#GROUP The Group
|
||||||
-- @return #nil Nothing found
|
-- @return #nil Nothing found
|
||||||
function SPAWN:_GetGroupFromDCSUnit( DCSUnit )
|
function SPAWN:_GetGroupFromDCSUnit( DCSUnit )
|
||||||
self:F3( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, DCSUnit } )
|
self:F3( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, DCSUnit } )
|
||||||
@ -1404,7 +1404,7 @@ end
|
|||||||
-- TODO Need to delete this... _DATABASE does this now ...
|
-- TODO Need to delete this... _DATABASE does this now ...
|
||||||
|
|
||||||
--- @param #SPAWN self
|
--- @param #SPAWN self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SPAWN:_OnBirth( Event )
|
function SPAWN:_OnBirth( Event )
|
||||||
|
|
||||||
if timer.getTime0() < timer.getAbsTime() then
|
if timer.getTime0() < timer.getAbsTime() then
|
||||||
@ -1424,7 +1424,7 @@ end
|
|||||||
-- @todo Need to delete this... _DATABASE does this now ...
|
-- @todo Need to delete this... _DATABASE does this now ...
|
||||||
|
|
||||||
--- @param #SPAWN self
|
--- @param #SPAWN self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function SPAWN:_OnDeadOrCrash( Event )
|
function SPAWN:_OnDeadOrCrash( Event )
|
||||||
self:F( self.SpawnTemplatePrefix, Event )
|
self:F( self.SpawnTemplatePrefix, Event )
|
||||||
|
|
||||||
@ -1526,7 +1526,7 @@ function SPAWN:_SpawnCleanUpScheduler()
|
|||||||
|
|
||||||
for UnitID, UnitData in pairs( SpawnUnits ) do
|
for UnitID, UnitData in pairs( SpawnUnits ) do
|
||||||
|
|
||||||
local SpawnUnit = UnitData -- Unit#UNIT
|
local SpawnUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local SpawnUnitName = SpawnUnit:GetName()
|
local SpawnUnitName = SpawnUnit:GetName()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ Include.File( "Core/Database" )
|
|||||||
Include.File( "Core/Set" )
|
Include.File( "Core/Set" )
|
||||||
Include.File( "Core/Point" )
|
Include.File( "Core/Point" )
|
||||||
Include.File( "Core/Message" )
|
Include.File( "Core/Message" )
|
||||||
Include.File( "Core/StateMachine" )
|
|
||||||
|
|
||||||
--- Wrapper Classes
|
--- Wrapper Classes
|
||||||
Include.File( "Wrapper/Object" )
|
Include.File( "Wrapper/Object" )
|
||||||
@ -40,6 +39,7 @@ Include.File( "Functional/Detection" )
|
|||||||
Include.File( "Functional/AIBalancer" )
|
Include.File( "Functional/AIBalancer" )
|
||||||
|
|
||||||
--- Fsm Classes
|
--- Fsm Classes
|
||||||
|
Include.File( "Fsm/Fsm" )
|
||||||
Include.File( "Fsm/Process" )
|
Include.File( "Fsm/Process" )
|
||||||
Include.File( "Fsm/Process_JTAC" )
|
Include.File( "Fsm/Process_JTAC" )
|
||||||
Include.File( "Fsm/Patrol" )
|
Include.File( "Fsm/Patrol" )
|
||||||
|
|||||||
@ -41,7 +41,7 @@ end
|
|||||||
--- The COMMANDCENTER class
|
--- The COMMANDCENTER class
|
||||||
-- @type COMMANDCENTER
|
-- @type COMMANDCENTER
|
||||||
-- @field Wrapper.Group#GROUP HQ
|
-- @field Wrapper.Group#GROUP HQ
|
||||||
-- @field Dcs.DCSCoalitionObject#coalition CommandCenterCoalition
|
-- @field Dcs.DCSCoalitionWrapper.Object#coalition CommandCenterCoalition
|
||||||
-- @list<Tasking.Mission#MISSION> Missions
|
-- @list<Tasking.Mission#MISSION> Missions
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
COMMANDCENTER = {
|
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.
|
-- 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:
|
-- 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:
|
-- 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}().
|
-- 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 @{DetectionManager#DETECTION_MANAGER.SetReportDisplayTime}().
|
-- To control how long a reporting message is displayed, use @{Tasking.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.
|
-- 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.
|
-- 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 @{DetectionManager#DETECTION_MANAGER#ReportNow}().
|
-- 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.
|
-- 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:
|
-- 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.
|
--- DETECTION_MANAGER class.
|
||||||
-- @type DETECTION_MANAGER
|
-- @type DETECTION_MANAGER
|
||||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
-- @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
|
-- @extends Base#BASE
|
||||||
DETECTION_MANAGER = {
|
DETECTION_MANAGER = {
|
||||||
ClassName = "DETECTION_MANAGER",
|
ClassName = "DETECTION_MANAGER",
|
||||||
@ -75,12 +75,12 @@ do -- DETECTION MANAGER
|
|||||||
--- FAC constructor.
|
--- FAC constructor.
|
||||||
-- @param #DETECTION_MANAGER self
|
-- @param #DETECTION_MANAGER self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Set#SET_GROUP SetGroup
|
||||||
-- @param Detection#DETECTION_BASE Detection
|
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||||
-- @return #DETECTION_MANAGER self
|
-- @return #DETECTION_MANAGER self
|
||||||
function DETECTION_MANAGER:New( SetGroup, Detection )
|
function DETECTION_MANAGER:New( SetGroup, Detection )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- 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.SetGroup = SetGroup
|
||||||
self.Detection = Detection
|
self.Detection = Detection
|
||||||
@ -125,7 +125,7 @@ do -- DETECTION MANAGER
|
|||||||
|
|
||||||
--- Reports the detected items to the @{Set#SET_GROUP}.
|
--- Reports the detected items to the @{Set#SET_GROUP}.
|
||||||
-- @param #DETECTION_MANAGER self
|
-- @param #DETECTION_MANAGER self
|
||||||
-- @param Detection#DETECTION_BASE Detection
|
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||||
-- @return #DETECTION_MANAGER self
|
-- @return #DETECTION_MANAGER self
|
||||||
function DETECTION_MANAGER:ReportDetected( Detection )
|
function DETECTION_MANAGER:ReportDetected( Detection )
|
||||||
self:F2()
|
self:F2()
|
||||||
@ -148,7 +148,7 @@ do -- DETECTION MANAGER
|
|||||||
return self
|
return self
|
||||||
end
|
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
|
-- @param #DETECTION_MANAGER self
|
||||||
function DETECTION_MANAGER:_FacScheduler( SchedulerName )
|
function DETECTION_MANAGER:_FacScheduler( SchedulerName )
|
||||||
self:F2( { SchedulerName } )
|
self:F2( { SchedulerName } )
|
||||||
@ -156,7 +156,7 @@ do -- DETECTION MANAGER
|
|||||||
return self:ProcessDetected( self.Detection )
|
return self:ProcessDetected( self.Detection )
|
||||||
|
|
||||||
-- self.SetGroup:ForEachGroup(
|
-- self.SetGroup:ForEachGroup(
|
||||||
-- --- @param Group#GROUP Group
|
-- --- @param Wrapper.Group#GROUP Group
|
||||||
-- function( Group )
|
-- function( Group )
|
||||||
-- if Group:IsAlive() then
|
-- if Group:IsAlive() then
|
||||||
-- return self:ProcessDetected( self.Detection )
|
-- return self:ProcessDetected( self.Detection )
|
||||||
@ -175,7 +175,7 @@ do -- DETECTION_REPORTING
|
|||||||
--- DETECTION_REPORTING class.
|
--- DETECTION_REPORTING class.
|
||||||
-- @type DETECTION_REPORTING
|
-- @type DETECTION_REPORTING
|
||||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
-- @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
|
-- @extends #DETECTION_MANAGER
|
||||||
DETECTION_REPORTING = {
|
DETECTION_REPORTING = {
|
||||||
ClassName = "DETECTION_REPORTING",
|
ClassName = "DETECTION_REPORTING",
|
||||||
@ -185,7 +185,7 @@ do -- DETECTION_REPORTING
|
|||||||
--- DETECTION_REPORTING constructor.
|
--- DETECTION_REPORTING constructor.
|
||||||
-- @param #DETECTION_REPORTING self
|
-- @param #DETECTION_REPORTING self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Set#SET_GROUP SetGroup
|
||||||
-- @param Detection#DETECTION_AREAS Detection
|
-- @param Functional.Detection#DETECTION_AREAS Detection
|
||||||
-- @return #DETECTION_REPORTING self
|
-- @return #DETECTION_REPORTING self
|
||||||
function DETECTION_REPORTING:New( SetGroup, Detection )
|
function DETECTION_REPORTING:New( SetGroup, Detection )
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ do -- DETECTION_REPORTING
|
|||||||
|
|
||||||
--- Creates a string of the detected items in a @{Detection}.
|
--- Creates a string of the detected items in a @{Detection}.
|
||||||
-- @param #DETECTION_MANAGER self
|
-- @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
|
-- @return #DETECTION_MANAGER self
|
||||||
function DETECTION_REPORTING:GetDetectedItemsText( DetectedSet )
|
function DETECTION_REPORTING:GetDetectedItemsText( DetectedSet )
|
||||||
self:F2()
|
self:F2()
|
||||||
@ -207,7 +207,7 @@ do -- DETECTION_REPORTING
|
|||||||
local UnitTypes = {}
|
local UnitTypes = {}
|
||||||
|
|
||||||
for DetectedUnitID, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
for DetectedUnitID, DetectedUnitData in pairs( DetectedSet:GetSet() ) do
|
||||||
local DetectedUnit = DetectedUnitData -- Unit#UNIT
|
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
local UnitType = DetectedUnit:GetTypeName()
|
local UnitType = DetectedUnit:GetTypeName()
|
||||||
|
|
||||||
@ -230,8 +230,8 @@ do -- DETECTION_REPORTING
|
|||||||
|
|
||||||
--- Reports the detected items to the @{Set#SET_GROUP}.
|
--- Reports the detected items to the @{Set#SET_GROUP}.
|
||||||
-- @param #DETECTION_REPORTING self
|
-- @param #DETECTION_REPORTING self
|
||||||
-- @param Group#GROUP Group The @{Group} object to where the report needs to go.
|
-- @param Wrapper.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 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.
|
-- @return #boolean Return true if you want the reporting to continue... false will cancel the reporting loop.
|
||||||
function DETECTION_REPORTING:ProcessDetected( Group, Detection )
|
function DETECTION_REPORTING:ProcessDetected( Group, Detection )
|
||||||
self:F2( Group )
|
self:F2( Group )
|
||||||
@ -239,7 +239,7 @@ do -- DETECTION_REPORTING
|
|||||||
self:E( Group )
|
self:E( Group )
|
||||||
local DetectedMsg = {}
|
local DetectedMsg = {}
|
||||||
for DetectedAreaID, DetectedAreaData in pairs( Detection:GetDetectedAreas() ) do
|
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 )
|
DetectedMsg[#DetectedMsg+1] = " - Group #" .. DetectedAreaID .. ": " .. self:GetDetectedItemsText( DetectedArea.Set )
|
||||||
end
|
end
|
||||||
local FACGroup = Detection:GetDetectionGroups()
|
local FACGroup = Detection:GetDetectionGroups()
|
||||||
@ -255,10 +255,10 @@ do -- DETECTION_DISPATCHER
|
|||||||
--- DETECTION_DISPATCHER class.
|
--- DETECTION_DISPATCHER class.
|
||||||
-- @type DETECTION_DISPATCHER
|
-- @type DETECTION_DISPATCHER
|
||||||
-- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to.
|
-- @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.
|
||||||
-- @field Mission#MISSION Mission
|
-- @field Tasking.Mission#MISSION Mission
|
||||||
-- @field Group#GROUP CommandCenter
|
-- @field Wrapper.Group#GROUP CommandCenter
|
||||||
-- @extends DetectionManager#DETECTION_MANAGER
|
-- @extends Tasking.DetectionManager#DETECTION_MANAGER
|
||||||
DETECTION_DISPATCHER = {
|
DETECTION_DISPATCHER = {
|
||||||
ClassName = "DETECTION_DISPATCHER",
|
ClassName = "DETECTION_DISPATCHER",
|
||||||
Mission = nil,
|
Mission = nil,
|
||||||
@ -270,7 +270,7 @@ do -- DETECTION_DISPATCHER
|
|||||||
--- DETECTION_DISPATCHER constructor.
|
--- DETECTION_DISPATCHER constructor.
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @param #DETECTION_DISPATCHER self
|
||||||
-- @param Set#SET_GROUP SetGroup
|
-- @param Set#SET_GROUP SetGroup
|
||||||
-- @param Detection#DETECTION_BASE Detection
|
-- @param Functional.Detection#DETECTION_BASE Detection
|
||||||
-- @return #DETECTION_DISPATCHER self
|
-- @return #DETECTION_DISPATCHER self
|
||||||
function DETECTION_DISPATCHER:New( Mission, CommandCenter, SetGroup, Detection )
|
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.
|
--- Creates a SEAD task when there are targets for it.
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @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 Set#SET_UNIT TargetSetUnit: The target set of units.
|
||||||
-- @return #nil If there are no targets to be set.
|
-- @return #nil If there are no targets to be set.
|
||||||
function DETECTION_DISPATCHER:EvaluateSEAD( DetectedArea )
|
function DETECTION_DISPATCHER:EvaluateSEAD( DetectedArea )
|
||||||
@ -316,8 +316,8 @@ do -- DETECTION_DISPATCHER
|
|||||||
|
|
||||||
--- Creates a CAS task when there are targets for it.
|
--- Creates a CAS task when there are targets for it.
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @param #DETECTION_DISPATCHER self
|
||||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||||
-- @return Task#TASK_BASE
|
-- @return Tasking.Task#TASK_BASE
|
||||||
function DETECTION_DISPATCHER:EvaluateCAS( DetectedArea )
|
function DETECTION_DISPATCHER:EvaluateCAS( DetectedArea )
|
||||||
self:F( { DetectedArea.AreaID } )
|
self:F( { DetectedArea.AreaID } )
|
||||||
|
|
||||||
@ -344,8 +344,8 @@ do -- DETECTION_DISPATCHER
|
|||||||
|
|
||||||
--- Creates a BAI task when there are targets for it.
|
--- Creates a BAI task when there are targets for it.
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @param #DETECTION_DISPATCHER self
|
||||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||||
-- @return Task#TASK_BASE
|
-- @return Tasking.Task#TASK_BASE
|
||||||
function DETECTION_DISPATCHER:EvaluateBAI( DetectedArea, FriendlyCoalition )
|
function DETECTION_DISPATCHER:EvaluateBAI( DetectedArea, FriendlyCoalition )
|
||||||
self:F( { DetectedArea.AreaID } )
|
self:F( { DetectedArea.AreaID } )
|
||||||
|
|
||||||
@ -373,10 +373,10 @@ do -- DETECTION_DISPATCHER
|
|||||||
--- Evaluates the removal of the Task from the Mission.
|
--- 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".
|
-- Can only occur when the DetectedArea is Changed AND the state of the Task is "Planned".
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @param #DETECTION_DISPATCHER self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Task#TASK_BASE Task
|
-- @param Tasking.Task#TASK_BASE Task
|
||||||
-- @param Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
-- @param Functional.Detection#DETECTION_AREAS.DetectedArea DetectedArea
|
||||||
-- @return Task#TASK_BASE
|
-- @return Tasking.Task#TASK_BASE
|
||||||
function DETECTION_DISPATCHER:EvaluateRemoveTask( Mission, Task, DetectedArea )
|
function DETECTION_DISPATCHER:EvaluateRemoveTask( Mission, Task, DetectedArea )
|
||||||
|
|
||||||
if Task then
|
if Task then
|
||||||
@ -393,7 +393,7 @@ do -- DETECTION_DISPATCHER
|
|||||||
|
|
||||||
--- Assigns tasks in relation to the detected items to the @{Set#SET_GROUP}.
|
--- Assigns tasks in relation to the detected items to the @{Set#SET_GROUP}.
|
||||||
-- @param #DETECTION_DISPATCHER self
|
-- @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.
|
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
||||||
function DETECTION_DISPATCHER:ProcessDetected( Detection )
|
function DETECTION_DISPATCHER:ProcessDetected( Detection )
|
||||||
self:F2()
|
self:F2()
|
||||||
@ -407,7 +407,7 @@ do -- DETECTION_DISPATCHER
|
|||||||
--- First we need to the detected targets.
|
--- First we need to the detected targets.
|
||||||
for DetectedAreaID, DetectedAreaData in ipairs( Detection:GetDetectedAreas() ) do
|
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 DetectedSet = DetectedArea.Set
|
||||||
local DetectedZone = DetectedArea.Zone
|
local DetectedZone = DetectedArea.Zone
|
||||||
self:E( { "Targets in DetectedArea", DetectedArea.AreaID, DetectedSet:Count(), tostring( DetectedArea ) } )
|
self:E( { "Targets in DetectedArea", DetectedArea.AreaID, DetectedSet:Count(), tostring( DetectedArea ) } )
|
||||||
|
|||||||
@ -5,9 +5,9 @@
|
|||||||
--- The MISSION class
|
--- The MISSION class
|
||||||
-- @type MISSION
|
-- @type MISSION
|
||||||
-- @field #MISSION.Clients _Clients
|
-- @field #MISSION.Clients _Clients
|
||||||
-- @field Menu#MENU_COALITION MissionMenu
|
-- @field Core.Menu#MENU_COALITION MissionMenu
|
||||||
-- @field #string MissionBriefing
|
-- @field #string MissionBriefing
|
||||||
-- @extends Core.StateMachine#STATEMACHINE
|
-- @extends Core.StateMachine#FSM
|
||||||
MISSION = {
|
MISSION = {
|
||||||
ClassName = "MISSION",
|
ClassName = "MISSION",
|
||||||
Name = "",
|
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 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 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 #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
|
-- @return #MISSION self
|
||||||
function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition )
|
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" )
|
self:SetStartState( "Idle" )
|
||||||
|
|
||||||
@ -128,13 +128,13 @@ end
|
|||||||
|
|
||||||
--- Sets the Assigned Task menu.
|
--- Sets the Assigned Task menu.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Task#TASK_BASE Task
|
-- @param Tasking.Task#TASK_BASE Task
|
||||||
-- @param #string MenuText The menu text.
|
-- @param #string MenuText The menu text.
|
||||||
-- @return #MISSION self
|
-- @return #MISSION self
|
||||||
function MISSION:SetAssignedMenu( Task )
|
function MISSION:SetAssignedMenu( Task )
|
||||||
|
|
||||||
for _, Task in pairs( self.Tasks ) do
|
for _, Task in pairs( self.Tasks ) do
|
||||||
local Task = Task -- Task#TASK_BASE
|
local Task = Task -- Tasking.Task#TASK_BASE
|
||||||
Task:RemoveMenu()
|
Task:RemoveMenu()
|
||||||
Task:SetAssignedMenu()
|
Task:SetAssignedMenu()
|
||||||
end
|
end
|
||||||
@ -143,7 +143,7 @@ end
|
|||||||
|
|
||||||
--- Removes a Task menu.
|
--- Removes a Task menu.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Task#TASK_BASE Task
|
-- @param Tasking.Task#TASK_BASE Task
|
||||||
-- @return #MISSION self
|
-- @return #MISSION self
|
||||||
function MISSION:RemoveTaskMenu( Task )
|
function MISSION:RemoveTaskMenu( Task )
|
||||||
|
|
||||||
@ -153,8 +153,8 @@ end
|
|||||||
|
|
||||||
--- Gets the mission menu for the coalition.
|
--- Gets the mission menu for the coalition.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @return Menu#MENU_COALITION self
|
-- @return Core.Menu#MENU_COALITION self
|
||||||
function MISSION:GetMissionMenu( TaskGroup )
|
function MISSION:GetMissionMenu( TaskGroup )
|
||||||
|
|
||||||
local CommandCenter = self:GetCommandCenter()
|
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.
|
--- 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}.
|
-- @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.
|
-- @return #nil Returns nil if no task was found.
|
||||||
function MISSION:GetTask( TaskName )
|
function MISSION:GetTask( TaskName )
|
||||||
self:F( { TaskName } )
|
self:F( { TaskName } )
|
||||||
@ -192,8 +192,8 @@ end
|
|||||||
-- Note that there can be multiple @{Task}s registered to be completed.
|
-- 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.
|
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Task#TASK_BASE Task is the @{Task} object.
|
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
|
||||||
-- @return Task#TASK_BASE The task added.
|
-- @return Tasking.Task#TASK_BASE The task added.
|
||||||
function MISSION:AddTask( Task )
|
function MISSION:AddTask( Task )
|
||||||
|
|
||||||
local TaskName = Task:GetTaskName()
|
local TaskName = Task:GetTaskName()
|
||||||
@ -209,7 +209,7 @@ end
|
|||||||
-- Note that there can be multiple @{Task}s registered to be completed.
|
-- 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.
|
-- Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.
|
||||||
-- @param #MISSION self
|
-- @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.
|
-- @return #nil The cleaned Task reference.
|
||||||
function MISSION:RemoveTask( Task )
|
function MISSION:RemoveTask( Task )
|
||||||
|
|
||||||
@ -231,8 +231,8 @@ end
|
|||||||
|
|
||||||
--- Return the next @{Task} ID to be completed within the @{Mission}.
|
--- Return the next @{Task} ID to be completed within the @{Mission}.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Task#TASK_BASE Task is the @{Task} object.
|
-- @param Tasking.Task#TASK_BASE Task is the @{Task} object.
|
||||||
-- @return Task#TASK_BASE The task added.
|
-- @return Tasking.Task#TASK_BASE The task added.
|
||||||
function MISSION:GetNextTaskID( Task )
|
function MISSION:GetNextTaskID( Task )
|
||||||
|
|
||||||
local TaskName = Task:GetTaskName()
|
local TaskName = Task:GetTaskName()
|
||||||
@ -513,7 +513,7 @@ function MISSIONSCHEDULER.Scheduler()
|
|||||||
|
|
||||||
for ClientID, ClientData in pairs( Mission._Clients ) do
|
for ClientID, ClientData in pairs( Mission._Clients ) do
|
||||||
|
|
||||||
local Client = ClientData -- Client#CLIENT
|
local Client = ClientData -- Wrapper.Client#CLIENT
|
||||||
|
|
||||||
if Client:IsAlive() then
|
if Client:IsAlive() then
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
--- This module contains the TASK_BASE class.
|
--- 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.
|
-- 1.1) The @{#TASK_BASE} class implements the methods for task orchestration within MOOSE.
|
||||||
-- ----------------------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------------------
|
||||||
@ -51,11 +51,11 @@
|
|||||||
|
|
||||||
--- The TASK_BASE class
|
--- The TASK_BASE class
|
||||||
-- @type TASK_BASE
|
-- @type TASK_BASE
|
||||||
-- @field Scheduler#SCHEDULER TaskScheduler
|
-- @field Core.Scheduler#SCHEDULER TaskScheduler
|
||||||
-- @field Mission#MISSION Mission
|
-- @field Tasking.Mission#MISSION Mission
|
||||||
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
|
-- @field Core.Set#SET_GROUP SetGroup The Set of Groups assigned to the Task
|
||||||
-- @field Core.StateMachine#STATEMACHINE_TEMPLATE FsmTemplate
|
-- @field Core.StateMachine#FSM_TEMPLATE FsmTemplate
|
||||||
-- @extends Core.StateMachine#STATEMACHINE_TASK
|
-- @extends Core.StateMachine#FSM_TASK
|
||||||
TASK_BASE = {
|
TASK_BASE = {
|
||||||
ClassName = "TASK_BASE",
|
ClassName = "TASK_BASE",
|
||||||
TaskScheduler = nil,
|
TaskScheduler = nil,
|
||||||
@ -70,14 +70,14 @@ TASK_BASE = {
|
|||||||
|
|
||||||
--- Instantiates a new TASK_BASE. Should never be used. Interface Class.
|
--- Instantiates a new TASK_BASE. Should never be used. Interface Class.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Mission#MISSION Mission The mission wherein the Task is registered.
|
-- @param Tasking.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 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 TaskName The name of the Task
|
||||||
-- @param #string TaskType The type of the Task
|
-- @param #string TaskType The type of the Task
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
|
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:SetStartState( "Planned" )
|
||||||
self:AddTransition( "Planned", "Assign", "Assigned" )
|
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.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.
|
-- Handle the birth of new planes within the assigned set.
|
||||||
self:EventOnPlayerEnterUnit(
|
self:EventOnPlayerEnterUnit(
|
||||||
@ -142,7 +142,7 @@ end
|
|||||||
|
|
||||||
--- Assign the @{Task}to a @{Group}.
|
--- Assign the @{Task}to a @{Group}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @return #TASK_BASE
|
-- @return #TASK_BASE
|
||||||
function TASK_BASE:AssignToGroup( TaskGroup )
|
function TASK_BASE:AssignToGroup( TaskGroup )
|
||||||
self:F2( TaskGroup:GetName() )
|
self:F2( TaskGroup:GetName() )
|
||||||
@ -156,7 +156,7 @@ function TASK_BASE:AssignToGroup( TaskGroup )
|
|||||||
|
|
||||||
local TaskUnits = TaskGroup:GetUnits()
|
local TaskUnits = TaskGroup:GetUnits()
|
||||||
for UnitID, UnitData in pairs( TaskUnits ) do
|
for UnitID, UnitData in pairs( TaskUnits ) do
|
||||||
local TaskUnit = UnitData -- Unit#UNIT
|
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local PlayerName = TaskUnit:GetPlayerName()
|
local PlayerName = TaskUnit:GetPlayerName()
|
||||||
self:E(PlayerName)
|
self:E(PlayerName)
|
||||||
if PlayerName ~= nil or PlayerName ~= "" then
|
if PlayerName ~= nil or PlayerName ~= "" then
|
||||||
@ -179,13 +179,13 @@ end
|
|||||||
|
|
||||||
--- Assign the @{Task} to an alive @{Unit}.
|
--- Assign the @{Task} to an alive @{Unit}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:AssignToUnit( TaskUnit )
|
function TASK_BASE:AssignToUnit( TaskUnit )
|
||||||
self:F( TaskUnit:GetName() )
|
self:F( TaskUnit:GetName() )
|
||||||
|
|
||||||
-- Assign a new FsmUnit to TaskUnit.
|
-- 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 ) } )
|
self:E({"Address FsmUnit", tostring( FsmUnit ) } )
|
||||||
|
|
||||||
-- Set the events
|
-- Set the events
|
||||||
@ -204,7 +204,7 @@ end
|
|||||||
|
|
||||||
--- UnAssign the @{Task} from an alive @{Unit}.
|
--- UnAssign the @{Task} from an alive @{Unit}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:UnAssignFromUnit( TaskUnitName )
|
function TASK_BASE:UnAssignFromUnit( TaskUnitName )
|
||||||
self:F( TaskUnitName )
|
self:F( TaskUnitName )
|
||||||
@ -254,7 +254,7 @@ end
|
|||||||
|
|
||||||
--- Returns if the @{Task} is assigned to the Group.
|
--- Returns if the @{Task} is assigned to the Group.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
function TASK_BASE:IsAssignedToGroup( TaskGroup )
|
function TASK_BASE:IsAssignedToGroup( TaskGroup )
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ end
|
|||||||
|
|
||||||
--- Set the planned menu option of the @{Task}.
|
--- Set the planned menu option of the @{Task}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @param #string MenuText The menu text.
|
-- @param #string MenuText The menu text.
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:SetPlannedMenuForGroup( TaskGroup, MenuText )
|
function TASK_BASE:SetPlannedMenuForGroup( TaskGroup, MenuText )
|
||||||
@ -322,7 +322,7 @@ end
|
|||||||
|
|
||||||
--- Set the assigned menu options of the @{Task}.
|
--- Set the assigned menu options of the @{Task}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:SetAssignedMenuForGroup( TaskGroup )
|
function TASK_BASE:SetAssignedMenuForGroup( TaskGroup )
|
||||||
self:E( TaskGroup:GetName() )
|
self:E( TaskGroup:GetName() )
|
||||||
@ -340,7 +340,7 @@ end
|
|||||||
|
|
||||||
--- Remove the menu option of the @{Task} for a @{Group}.
|
--- Remove the menu option of the @{Task} for a @{Group}.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:RemoveMenuForGroup( TaskGroup )
|
function TASK_BASE:RemoveMenuForGroup( TaskGroup )
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ end
|
|||||||
|
|
||||||
--- Add a FiniteStateMachine to @{Task} with key @{Unit}
|
--- Add a FiniteStateMachine to @{Task} with key @{Unit}
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:SetStateMachine( TaskUnit, Fsm )
|
function TASK_BASE:SetStateMachine( TaskUnit, Fsm )
|
||||||
local TaskUnitName = TaskUnit:GetName()
|
local TaskUnitName = TaskUnit:GetName()
|
||||||
@ -452,7 +452,7 @@ end
|
|||||||
--- Register a potential new assignment for a new spawned @{Unit}.
|
--- Register a potential new assignment for a new spawned @{Unit}.
|
||||||
-- Tasks only get assigned if there are players in it.
|
-- Tasks only get assigned if there are players in it.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:_EventAssignUnit( Event )
|
function TASK_BASE:_EventAssignUnit( Event )
|
||||||
if Event.IniUnit then
|
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.
|
-- * 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.
|
-- This is important to model the change from plane types for a player during mission assignment.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:_EventPlayerLeaveUnit( Event )
|
function TASK_BASE:_EventPlayerLeaveUnit( Event )
|
||||||
self:F( Event )
|
self:F( Event )
|
||||||
@ -510,7 +510,7 @@ end
|
|||||||
--- UnAssigns a @{Unit} that is left by a player, crashed, dead, ....
|
--- UnAssigns a @{Unit} that is left by a player, crashed, dead, ....
|
||||||
-- There are only assignments if there are players in it.
|
-- There are only assignments if there are players in it.
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
-- @return #TASK_BASE self
|
-- @return #TASK_BASE self
|
||||||
function TASK_BASE:_EventDead( Event )
|
function TASK_BASE:_EventDead( Event )
|
||||||
self:F( Event )
|
self:F( Event )
|
||||||
@ -688,12 +688,12 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Adds a score for the TASK to be achieved.
|
--- 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 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 #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.
|
-- @param #number Score is a number providing the score of the status.
|
||||||
-- @return #STATEMACHINE_TEMPLATE self
|
-- @return #FSM_TEMPLATE self
|
||||||
function STATEMACHINE_TEMPLATE:AddScoreTask( TaskStatus, ScoreText, Score )
|
function FSM_TEMPLATE:AddScoreTask( TaskStatus, ScoreText, Score )
|
||||||
self:F2( { TaskStatus, ScoreText, Score } )
|
self:F2( { TaskStatus, ScoreText, Score } )
|
||||||
|
|
||||||
self.Scores[TaskStatus] = self.Scores[TaskStatus] or {}
|
self.Scores[TaskStatus] = self.Scores[TaskStatus] or {}
|
||||||
@ -708,7 +708,7 @@ end
|
|||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function TASK_BASE:onenterAssigned( Event, From, To )
|
function TASK_BASE:onenterAssigned( Event, From, To )
|
||||||
|
|
||||||
self:E("Assigned")
|
self:E("Assigned")
|
||||||
@ -723,7 +723,7 @@ end
|
|||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function TASK_BASE:onenterSuccess( Event, From, To )
|
function TASK_BASE:onenterSuccess( Event, From, To )
|
||||||
|
|
||||||
self:E("Success")
|
self:E("Success")
|
||||||
@ -732,12 +732,12 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a TASK
|
--- StateMachine callback function for a TASK
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function TASK_BASE:OnFailed( TaskUnit, Fsm, Event, From, To )
|
function TASK_BASE:OnFailed( TaskUnit, Fsm, Event, From, To )
|
||||||
|
|
||||||
self:E( { "Failed for unit ", TaskUnit:GetName(), TaskUnit:GetPlayerName() } )
|
self:E( { "Failed for unit ", TaskUnit:GetName(), TaskUnit:GetPlayerName() } )
|
||||||
@ -753,12 +753,12 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a TASK
|
--- StateMachine callback function for a TASK
|
||||||
-- @param #TASK_BASE self
|
-- @param #TASK_BASE self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Event#EVENTDATA Event
|
-- @param Core.Event#EVENTDATA Event
|
||||||
function TASK_BASE:onstatechange( Event, From, To )
|
function TASK_BASE:onstatechange( Event, From, To )
|
||||||
|
|
||||||
if self:IsTrace() then
|
if self:IsTrace() then
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
--- TASK2_MENU_CLIENT class
|
--- TASK2_MENU_CLIENT class
|
||||||
-- @type TASK2_MENU_CLIENT
|
-- @type TASK2_MENU_CLIENT
|
||||||
-- @field Unit#UNIT TaskUnit
|
-- @field Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @field Set#SET_UNIT TargetSet
|
-- @field Core.Set#SET_UNIT TargetSet
|
||||||
-- @field Menu#MENU_CLIENT_COMMAND MenuTask
|
-- @field Core.Menu#MENU_CLIENT_COMMAND MenuTask
|
||||||
-- @extends Task2#TASK2
|
-- @extends Task2#TASK2
|
||||||
TASK2_MENU_CLIENT = {
|
TASK2_MENU_CLIENT = {
|
||||||
ClassName = "TASK2_MENU_CLIENT",
|
ClassName = "TASK2_MENU_CLIENT",
|
||||||
@ -14,8 +14,8 @@ TASK2_MENU_CLIENT = {
|
|||||||
|
|
||||||
--- Creates a new MENU handling machine.
|
--- Creates a new MENU handling machine.
|
||||||
-- @param #TASK2_MENU_CLIENT self
|
-- @param #TASK2_MENU_CLIENT self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param #string MenuText The text of the menu item.
|
-- @param #string MenuText The text of the menu item.
|
||||||
-- @return #TASK2_MENU_CLIENT self
|
-- @return #TASK2_MENU_CLIENT self
|
||||||
function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText )
|
function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText )
|
||||||
@ -25,7 +25,7 @@ function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText )
|
|||||||
|
|
||||||
self.MenuText = MenuText
|
self.MenuText = MenuText
|
||||||
|
|
||||||
self.Fsm = STATEMACHINE_TASK:New( self, {
|
self.Fsm = FSM_TASK:New( self, {
|
||||||
initial = 'Unassigned',
|
initial = 'Unassigned',
|
||||||
events = {
|
events = {
|
||||||
{ name = 'Menu', from = 'Unassigned', to = 'AwaitingMenu' },
|
{ name = 'Menu', from = 'Unassigned', to = 'AwaitingMenu' },
|
||||||
@ -47,7 +47,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a TASK2
|
--- StateMachine callback function for a TASK2
|
||||||
-- @param #TASK2_MENU_CLIENT self
|
-- @param #TASK2_MENU_CLIENT self
|
||||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
@ -71,7 +71,7 @@ end
|
|||||||
|
|
||||||
--- StateMachine callback function for a TASK2
|
--- StateMachine callback function for a TASK2
|
||||||
-- @param #TASK2_MENU_CLIENT self
|
-- @param #TASK2_MENU_CLIENT self
|
||||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
--- (AI) (SP) (MP) Tasking for Air to Ground Processes.
|
--- (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,
|
-- 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}.
|
-- located at a Target Zone, based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||||
-- The TASK_A2G is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
-- The TASK_A2G is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||||
--
|
--
|
||||||
-- * **None**: Start of the process
|
-- * **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.
|
-- * **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 @{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.
|
-- * **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.
|
-- * **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.
|
-- * **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.
|
--- Instantiates a new TASK_A2G.
|
||||||
-- @param #TASK_A2G self
|
-- @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 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 TaskName The name of the Task.
|
||||||
-- @param #string TaskType BAI or CAS
|
-- @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.
|
-- 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:
|
-- 1.1) AIBALANCER construction method:
|
||||||
-- ------------------------------------
|
-- ------------------------------------
|
||||||
@ -18,12 +18,12 @@
|
|||||||
-- ---------------------------------------
|
-- ---------------------------------------
|
||||||
-- You can configure to have the AI to return to:
|
-- You can configure to have the AI to return to:
|
||||||
--
|
--
|
||||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Airbase#AIRBASE}.
|
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||||
--
|
--
|
||||||
-- 1.3) AIBALANCER allows AI to patrol specific zones:
|
-- 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
|
--- AIBALANCER class
|
||||||
-- @type AIBALANCER
|
-- @type AIBALANCER
|
||||||
-- @field Set#SET_CLIENT SetClient
|
-- @field Core.Set#SET_CLIENT SetClient
|
||||||
-- @field Spawn#SPAWN SpawnAI
|
-- @field Functional.Spawn#SPAWN SpawnAI
|
||||||
-- @field #boolean ToNearestAirbase
|
-- @field #boolean ToNearestAirbase
|
||||||
-- @field Set#SET_AIRBASE ReturnAirbaseSet
|
-- @field Core.Set#SET_AIRBASE ReturnAirbaseSet
|
||||||
-- @field DCSTypes#Distance ReturnTresholdRange
|
-- @field Dcs.DCSTypes#Distance ReturnTresholdRange
|
||||||
-- @field #boolean ToHomeAirbase
|
-- @field #boolean ToHomeAirbase
|
||||||
-- @field PatrolZone#PATROLZONE PatrolZone
|
-- @field PatrolCore.Zone#PATROLZONE PatrolZone
|
||||||
-- @extends Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
AIBALANCER = {
|
AIBALANCER = {
|
||||||
ClassName = "AIBALANCER",
|
ClassName = "AIBALANCER",
|
||||||
PatrolZones = {},
|
PatrolZones = {},
|
||||||
@ -121,10 +121,10 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
--- Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- @param #AIBALANCER self
|
-- @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}.
|
||||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
-- @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 )
|
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||||
|
|
||||||
self.ToNearestAirbase = true
|
self.ToNearestAirbase = true
|
||||||
@ -132,9 +132,9 @@ function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseS
|
|||||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the AI to the home @{Airbase#AIRBASE}.
|
--- Returns the AI to the home @{Wrapper.Airbase#AIRBASE}.
|
||||||
-- @param #AIBALANCER self
|
-- @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 )
|
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||||
|
|
||||||
self.ToHomeAirbase = true
|
self.ToHomeAirbase = true
|
||||||
@ -143,8 +143,8 @@ end
|
|||||||
|
|
||||||
--- Let the AI patrol a @{Zone} with a given Speed range and Altitude range.
|
--- Let the AI patrol a @{Zone} with a given Speed range and Altitude range.
|
||||||
-- @param #AIBALANCER self
|
-- @param #AIBALANCER self
|
||||||
-- @param PatrolZone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
-- @param PatrolCore.Zone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||||
-- @return PatrolZone#PATROLZONE self
|
-- @return PatrolCore.Zone#PATROLZONE self
|
||||||
function AIBALANCER:SetPatrolZone( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
|
function AIBALANCER:SetPatrolZone( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
|
||||||
|
|
||||||
self.PatrolZone = PATROLZONE:New(
|
self.PatrolZone = PATROLZONE:New(
|
||||||
@ -159,7 +159,7 @@ end
|
|||||||
|
|
||||||
--- Get the @{PatrolZone} object assigned by the @{AIBalancer} object.
|
--- Get the @{PatrolZone} object assigned by the @{AIBalancer} object.
|
||||||
-- @param #AIBALANCER self
|
-- @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()
|
function AIBALANCER:GetPatrolZone()
|
||||||
|
|
||||||
return self.PatrolZone
|
return self.PatrolZone
|
||||||
@ -171,7 +171,7 @@ end
|
|||||||
function AIBALANCER:_ClientAliveMonitorScheduler()
|
function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||||
|
|
||||||
self.SetClient:ForEachClient(
|
self.SetClient:ForEachClient(
|
||||||
--- @param Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
function( Client )
|
function( Client )
|
||||||
local ClientAIAliveState = Client:GetState( self, 'AIAlive' )
|
local ClientAIAliveState = Client:GetState( self, 'AIAlive' )
|
||||||
self:T( ClientAIAliveState )
|
self:T( ClientAIAliveState )
|
||||||
@ -179,7 +179,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
|||||||
if ClientAIAliveState == true then
|
if ClientAIAliveState == true then
|
||||||
Client:SetState( self, 'AIAlive', false )
|
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" )
|
-- local PatrolZone = Client:GetState( self, "PatrolZone" )
|
||||||
-- if PatrolZone then
|
-- if PatrolZone then
|
||||||
@ -200,7 +200,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
|||||||
self:E( RangeZone )
|
self:E( RangeZone )
|
||||||
|
|
||||||
_DATABASE:ForEachPlayer(
|
_DATABASE:ForEachPlayer(
|
||||||
--- @param Unit#UNIT RangeTestUnit
|
--- @param Wrapper.Unit#UNIT RangeTestUnit
|
||||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||||
@ -213,7 +213,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
--- @param Zone#ZONE_RADIUS RangeZone
|
--- @param Zone#ZONE_RADIUS RangeZone
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function( RangeZone, AIGroup, PlayerInRange )
|
function( RangeZone, AIGroup, PlayerInRange )
|
||||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||||
if PlayerInRange.Value == false then
|
if PlayerInRange.Value == false then
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
--- This module contains the TASK_PICKUP classes.
|
--- 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.
|
-- 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}.
|
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||||
-- The TASK_PICKUP is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
-- The TASK_PICKUP is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||||
--
|
--
|
||||||
-- * **None**: Start of the process
|
-- * **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.
|
-- * **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 @{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.
|
-- * **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.
|
-- * **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.
|
-- * **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
|
--- The TASK_PICKUP class
|
||||||
-- @type TASK_PICKUP
|
-- @type TASK_PICKUP
|
||||||
-- @extends Task#TASK_BASE
|
-- @extends Tasking.Task#TASK_BASE
|
||||||
TASK_PICKUP = {
|
TASK_PICKUP = {
|
||||||
ClassName = "TASK_PICKUP",
|
ClassName = "TASK_PICKUP",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Instantiates a new TASK_PICKUP.
|
--- Instantiates a new TASK_PICKUP.
|
||||||
-- @param #TASK_PICKUP self
|
-- @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 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 TaskName The name of the Task.
|
||||||
-- @param #string TaskType BAI or CAS
|
-- @param #string TaskType BAI or CAS
|
||||||
@ -62,7 +62,7 @@ do -- TASK_PICKUP
|
|||||||
|
|
||||||
--- Assign the @{Task} to a @{Unit}.
|
--- Assign the @{Task} to a @{Unit}.
|
||||||
-- @param #TASK_PICKUP self
|
-- @param #TASK_PICKUP self
|
||||||
-- @param Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @return #TASK_PICKUP self
|
-- @return #TASK_PICKUP self
|
||||||
function TASK_PICKUP:AssignToUnit( TaskUnit )
|
function TASK_PICKUP:AssignToUnit( TaskUnit )
|
||||||
self:F( TaskUnit:GetName() )
|
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 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 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',
|
initial = 'None',
|
||||||
events = {
|
events = {
|
||||||
{ name = 'Next', from = 'None', to = 'Planned' },
|
{ name = 'Next', from = 'None', to = 'Planned' },
|
||||||
@ -98,7 +98,7 @@ do -- TASK_PICKUP
|
|||||||
|
|
||||||
--- StateMachine callback function for a TASK
|
--- StateMachine callback function for a TASK
|
||||||
-- @param #TASK_PICKUP self
|
-- @param #TASK_PICKUP self
|
||||||
-- @param StateMachine#STATEMACHINE_TASK Fsm
|
-- @param Fsm.Fsm#FSM_TASK Fsm
|
||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
--- This module contains the TASK_SEAD classes.
|
--- 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,
|
-- 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}.
|
-- based on the tasking capabilities defined in @{Tasking.Task#TASK_BASE}.
|
||||||
-- The TASK_SEAD is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses:
|
-- The TASK_SEAD is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
|
||||||
--
|
--
|
||||||
-- * **None**: Start of the process
|
-- * **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.
|
-- * **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 @{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.
|
-- * **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.
|
-- * **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.
|
-- * **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.
|
--- Instantiates a new TASK_SEAD.
|
||||||
-- @param #TASK_SEAD self
|
-- @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 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 TaskName The name of the Task.
|
||||||
-- @param Set#SET_UNIT UnitSetTargets
|
-- @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:
|
-- 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.
|
-- 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,
|
-- 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}().
|
-- is implemented in the AIRBASE class as @{#AIRBASE.GetName}().
|
||||||
--
|
--
|
||||||
-- More functions will be added
|
-- More functions will be added
|
||||||
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
--- The AIRBASE class
|
--- The AIRBASE class
|
||||||
-- @type AIRBASE
|
-- @type AIRBASE
|
||||||
-- @extends Positionable#POSITIONABLE
|
-- @extends Wrapper.Positionable#POSITIONABLE
|
||||||
AIRBASE = {
|
AIRBASE = {
|
||||||
ClassName="AIRBASE",
|
ClassName="AIRBASE",
|
||||||
CategoryName = {
|
CategoryName = {
|
||||||
@ -64,7 +64,7 @@ AIRBASE = {
|
|||||||
--- Create a new AIRBASE from DCSAirbase.
|
--- Create a new AIRBASE from DCSAirbase.
|
||||||
-- @param #AIRBASE self
|
-- @param #AIRBASE self
|
||||||
-- @param #string AirbaseName The name of the airbase.
|
-- @param #string AirbaseName The name of the airbase.
|
||||||
-- @return Airbase#AIRBASE
|
-- @return Wrapper.Airbase#AIRBASE
|
||||||
function AIRBASE:Register( AirbaseName )
|
function AIRBASE:Register( AirbaseName )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) )
|
local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) )
|
||||||
@ -76,8 +76,8 @@ end
|
|||||||
|
|
||||||
--- Finds a AIRBASE from the _DATABASE using a DCSAirbase object.
|
--- Finds a AIRBASE from the _DATABASE using a DCSAirbase object.
|
||||||
-- @param #AIRBASE self
|
-- @param #AIRBASE self
|
||||||
-- @param DCSAirbase#Airbase DCSAirbase An existing DCS Airbase object reference.
|
-- @param Dcs.DCSWrapper.Airbase#Airbase DCSAirbase An existing DCS Airbase object reference.
|
||||||
-- @return Airbase#AIRBASE self
|
-- @return Wrapper.Airbase#AIRBASE self
|
||||||
function AIRBASE:Find( DCSAirbase )
|
function AIRBASE:Find( DCSAirbase )
|
||||||
|
|
||||||
local AirbaseName = DCSAirbase:getName()
|
local AirbaseName = DCSAirbase:getName()
|
||||||
@ -88,7 +88,7 @@ end
|
|||||||
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
||||||
-- @param #AIRBASE self
|
-- @param #AIRBASE self
|
||||||
-- @param #string AirbaseName The Airbase Name.
|
-- @param #string AirbaseName The Airbase Name.
|
||||||
-- @return Airbase#AIRBASE self
|
-- @return Wrapper.Airbase#AIRBASE self
|
||||||
function AIRBASE:FindByName( AirbaseName )
|
function AIRBASE:FindByName( AirbaseName )
|
||||||
|
|
||||||
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
--- This module contains the CLIENT class.
|
--- 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__.
|
-- 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.
|
-- 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.
|
-- * Wraps the DCS Unit objects with skill level set to Player or Client.
|
||||||
-- * Support all DCS Unit APIs.
|
-- * Support all DCS Unit APIs.
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
--- The CLIENT class
|
--- The CLIENT class
|
||||||
-- @type CLIENT
|
-- @type CLIENT
|
||||||
-- @extends Unit#UNIT
|
-- @extends Wrapper.Unit#UNIT
|
||||||
CLIENT = {
|
CLIENT = {
|
||||||
ONBOARDSIDE = {
|
ONBOARDSIDE = {
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
@ -259,7 +259,7 @@ end
|
|||||||
--- Return the DCSGroup of a Client.
|
--- Return the DCSGroup of a Client.
|
||||||
-- This function is modified to deal with a couple of bugs in DCS 1.5.3
|
-- This function is modified to deal with a couple of bugs in DCS 1.5.3
|
||||||
-- @param #CLIENT self
|
-- @param #CLIENT self
|
||||||
-- @return DCSGroup#Group
|
-- @return Dcs.DCSWrapper.Group#Group
|
||||||
function CLIENT:GetDCSGroup()
|
function CLIENT:GetDCSGroup()
|
||||||
self:F3()
|
self:F3()
|
||||||
|
|
||||||
@ -333,10 +333,10 @@ function CLIENT:GetDCSGroup()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- TODO: Check DCSTypes#Group.ID
|
-- TODO: Check Dcs.DCSTypes#Group.ID
|
||||||
--- Get the group ID of the client.
|
--- Get the group ID of the client.
|
||||||
-- @param #CLIENT self
|
-- @param #CLIENT self
|
||||||
-- @return DCSTypes#Group.ID
|
-- @return Dcs.DCSTypes#Group.ID
|
||||||
function CLIENT:GetClientGroupID()
|
function CLIENT:GetClientGroupID()
|
||||||
|
|
||||||
local ClientGroup = self:GetDCSGroup()
|
local ClientGroup = self:GetDCSGroup()
|
||||||
@ -359,7 +359,7 @@ end
|
|||||||
|
|
||||||
--- Returns the UNIT of the CLIENT.
|
--- Returns the UNIT of the CLIENT.
|
||||||
-- @param #CLIENT self
|
-- @param #CLIENT self
|
||||||
-- @return Unit#UNIT
|
-- @return Wrapper.Unit#UNIT
|
||||||
function CLIENT:GetClientGroupUnit()
|
function CLIENT:GetClientGroupUnit()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ end
|
|||||||
|
|
||||||
--- Returns the DCSUnit of the CLIENT.
|
--- Returns the DCSUnit of the CLIENT.
|
||||||
-- @param #CLIENT self
|
-- @param #CLIENT self
|
||||||
-- @return DCSTypes#Unit
|
-- @return Dcs.DCSTypes#Unit
|
||||||
function CLIENT:GetClientGroupDCSUnit()
|
function CLIENT:GetClientGroupDCSUnit()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@ -396,8 +396,8 @@ function CLIENT:IsTransport()
|
|||||||
return self.ClientTransport
|
return self.ClientTransport
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Shows the @{Cargo#CARGO} contained within the CLIENT to the player as a message.
|
--- Shows the @{Fsm.Cargo#CARGO} contained within the CLIENT to the player as a message.
|
||||||
-- The @{Cargo#CARGO} is shown using the @{Message#MESSAGE} distribution system.
|
-- The @{Fsm.Cargo#CARGO} is shown using the @{Core.Message#MESSAGE} distribution system.
|
||||||
-- @param #CLIENT self
|
-- @param #CLIENT self
|
||||||
function CLIENT:ShowCargo()
|
function CLIENT:ShowCargo()
|
||||||
self:F()
|
self:F()
|
||||||
@ -430,7 +430,7 @@ end
|
|||||||
-- @param #string Message is the text describing the message.
|
-- @param #string Message is the text describing the message.
|
||||||
-- @param #number MessageDuration is the duration in seconds that the Message should be displayed.
|
-- @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 #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.
|
-- @param #string MessageID is the identifier of the message when displayed with intervals.
|
||||||
function CLIENT:Message( Message, MessageDuration, MessageCategory, MessageInterval, MessageID )
|
function CLIENT:Message( Message, MessageDuration, MessageCategory, MessageInterval, MessageID )
|
||||||
self:F( { Message, MessageDuration, MessageCategory, MessageInterval } )
|
self:F( { Message, MessageDuration, MessageCategory, MessageInterval } )
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
--- This module contains the CONTROLLABLE class.
|
--- 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.
|
-- * Support all DCS Controllable APIs.
|
||||||
-- * Enhance with Controllable specific APIs not in the DCS Controllable API set.
|
-- * Enhance with Controllable specific APIs not in the DCS Controllable API set.
|
||||||
@ -18,7 +18,7 @@
|
|||||||
-- 1.2) CONTROLLABLE task methods
|
-- 1.2) CONTROLLABLE task methods
|
||||||
-- ------------------------------
|
-- ------------------------------
|
||||||
-- Several controllable task methods are available that help you to prepare tasks.
|
-- 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.
|
-- 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.
|
-- 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.
|
-- 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.TaskHold}: (GROUND) Hold ground controllable from moving.
|
||||||
-- * @{#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the controllable.
|
-- * @{#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.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.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.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.
|
-- * @{#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||||
@ -128,7 +128,7 @@
|
|||||||
--- The CONTROLLABLE class
|
--- The CONTROLLABLE class
|
||||||
-- @type CONTROLLABLE
|
-- @type CONTROLLABLE
|
||||||
-- @extends Wrapper.Positionable#POSITIONABLE
|
-- @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.
|
-- @field #string ControllableName The name of the controllable.
|
||||||
CONTROLLABLE = {
|
CONTROLLABLE = {
|
||||||
ClassName = "CONTROLLABLE",
|
ClassName = "CONTROLLABLE",
|
||||||
@ -138,7 +138,7 @@ CONTROLLABLE = {
|
|||||||
|
|
||||||
--- Create a new CONTROLLABLE from a DCSControllable
|
--- Create a new CONTROLLABLE from a DCSControllable
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSControllable#Controllable ControllableName The DCS Controllable name
|
-- @param Dcs.DCSWrapper.Controllable#Controllable ControllableName The DCS Controllable name
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:New( ControllableName )
|
function CONTROLLABLE:New( ControllableName )
|
||||||
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) )
|
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) )
|
||||||
@ -151,7 +151,7 @@ end
|
|||||||
|
|
||||||
--- Get the controller for the CONTROLLABLE.
|
--- Get the controller for the CONTROLLABLE.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSController#Controller
|
-- @return Dcs.DCSController#Controller
|
||||||
function CONTROLLABLE:_GetController()
|
function CONTROLLABLE:_GetController()
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
local DCSControllable = self:GetDCSObject()
|
local DCSControllable = self:GetDCSObject()
|
||||||
@ -171,7 +171,7 @@ end
|
|||||||
|
|
||||||
--- Popping current Task from the controllable.
|
--- Popping current Task from the controllable.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return Controllable#CONTROLLABLE self
|
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||||
function CONTROLLABLE:PopCurrentTask()
|
function CONTROLLABLE:PopCurrentTask()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ end
|
|||||||
|
|
||||||
--- Pushing Task on the queue from the controllable.
|
--- Pushing Task on the queue from the controllable.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return Controllable#CONTROLLABLE self
|
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||||
function CONTROLLABLE:PushTask( DCSTask, WaitTime )
|
function CONTROLLABLE:PushTask( DCSTask, WaitTime )
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ end
|
|||||||
|
|
||||||
--- Clearing the Task Queue and Setting the Task on the queue from the controllable.
|
--- Clearing the Task Queue and Setting the Task on the queue from the controllable.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return Controllable#CONTROLLABLE self
|
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||||
function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||||
self:F2( { DCSTask } )
|
self:F2( { DCSTask } )
|
||||||
|
|
||||||
@ -245,13 +245,13 @@ end
|
|||||||
|
|
||||||
--- Return a condition section for a controlled task.
|
--- Return a condition section for a controlled task.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSTime#Time time
|
-- @param Dcs.DCSTime#Time time
|
||||||
-- @param #string userFlag
|
-- @param #string userFlag
|
||||||
-- @param #boolean userFlagValue
|
-- @param #boolean userFlagValue
|
||||||
-- @param #string condition
|
-- @param #string condition
|
||||||
-- @param DCSTime#Time duration
|
-- @param Dcs.DCSTime#Time duration
|
||||||
-- @param #number lastWayPoint
|
-- @param #number lastWayPoint
|
||||||
-- return DCSTask#Task
|
-- return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskCondition( time, userFlag, userFlagValue, condition, duration, lastWayPoint )
|
function CONTROLLABLE:TaskCondition( time, userFlag, userFlagValue, condition, duration, lastWayPoint )
|
||||||
self:F2( { 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.
|
--- Return a Controlled Task taking a Task and a TaskCondition.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSTask#Task DCSTask
|
-- @param Dcs.DCSTasking.Task#Task DCSTask
|
||||||
-- @param #DCSStopCondition DCSStopCondition
|
-- @param #DCSStopCondition DCSStopCondition
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskControlled( DCSTask, DCSStopCondition )
|
function CONTROLLABLE:TaskControlled( DCSTask, DCSStopCondition )
|
||||||
self:F2( { DCSTask, DCSStopCondition } )
|
self:F2( { DCSTask, DCSStopCondition } )
|
||||||
|
|
||||||
@ -291,8 +291,8 @@ end
|
|||||||
|
|
||||||
--- Return a Combo Task taking an array of Tasks.
|
--- Return a Combo Task taking an array of Tasks.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSTask#TaskArray DCSTasks Array of @{DCSTask#Task}
|
-- @param Dcs.DCSTasking.Task#TaskArray DCSTasks Array of @{Dcs.DCSTasking.Task#Task}
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskCombo( DCSTasks )
|
function CONTROLLABLE:TaskCombo( DCSTasks )
|
||||||
self:F2( { DCSTasks } )
|
self:F2( { DCSTasks } )
|
||||||
|
|
||||||
@ -311,8 +311,8 @@ end
|
|||||||
|
|
||||||
--- Return a WrappedAction Task taking a Command.
|
--- Return a WrappedAction Task taking a Command.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSCommand#Command DCSCommand
|
-- @param Dcs.DCSCommand#Command DCSCommand
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskWrappedAction( DCSCommand, Index )
|
function CONTROLLABLE:TaskWrappedAction( DCSCommand, Index )
|
||||||
self:F2( { DCSCommand } )
|
self:F2( { DCSCommand } )
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ end
|
|||||||
|
|
||||||
--- Executes a command action
|
--- Executes a command action
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSCommand#Command DCSCommand
|
-- @param Dcs.DCSCommand#Command DCSCommand
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:SetCommand( DCSCommand )
|
function CONTROLLABLE:SetCommand( DCSCommand )
|
||||||
self:F2( DCSCommand )
|
self:F2( DCSCommand )
|
||||||
@ -354,7 +354,7 @@ end
|
|||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #number FromWayPoint
|
-- @param #number FromWayPoint
|
||||||
-- @param #number ToWayPoint
|
-- @param #number ToWayPoint
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
-- @usage
|
-- @usage
|
||||||
-- --- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
|
-- --- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
|
||||||
-- HeliGroup = GROUP:FindByName( "Helicopter" )
|
-- HeliGroup = GROUP:FindByName( "Helicopter" )
|
||||||
@ -385,7 +385,7 @@ end
|
|||||||
--- Perform stop route command
|
--- Perform stop route command
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #boolean StopRoute
|
-- @param #boolean StopRoute
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:CommandStopRoute( StopRoute, Index )
|
function CONTROLLABLE:CommandStopRoute( StopRoute, Index )
|
||||||
self:F2( { StopRoute, Index } )
|
self:F2( { StopRoute, Index } )
|
||||||
|
|
||||||
@ -406,14 +406,14 @@ end
|
|||||||
|
|
||||||
--- (AIR) Attack a Controllable.
|
--- (AIR) Attack a Controllable.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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 #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 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#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.
|
-- @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 )
|
function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Attack the Unit.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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 #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 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.
|
-- @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 )
|
function CONTROLLABLE:TaskAttackUnit( AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Delivering weapon at the point on the ground.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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 #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.
|
-- @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 )
|
function CONTROLLABLE:TaskBombing( Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 Altitude The altitude to hold the position.
|
||||||
-- @param #number Speed The speed flying when holding the position.
|
-- @param #number Speed The speed flying when holding the position.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
@ -626,13 +626,13 @@ end
|
|||||||
|
|
||||||
--- (AIR) Attacking the map object (building, structure, e.t.c).
|
--- (AIR) Attacking the map object (building, structure, e.t.c).
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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 #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.
|
-- @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 )
|
function CONTROLLABLE:TaskAttackMapObject( Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Delivering weapon on the runway.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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 #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.
|
-- @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 )
|
function CONTROLLABLE:TaskBombingRunway( Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Refueling from the nearest tanker. No parameters.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:TaskRefueling()
|
function CONTROLLABLE:TaskRefueling()
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
@ -730,7 +730,7 @@ end
|
|||||||
|
|
||||||
--- (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
--- (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:TaskLandAtVec2( Point, Duration )
|
function CONTROLLABLE:TaskLandAtVec2( Point, Duration )
|
||||||
@ -767,9 +767,9 @@ function CONTROLLABLE:TaskLandAtVec2( Point, Duration )
|
|||||||
return DCSTask
|
return DCSTask
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (AIR) Land the controllable at a @{Zone#ZONE_RADIUS).
|
--- (AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:TaskLandAtZone( Zone, Duration, RandomPoint )
|
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.
|
-- 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.
|
-- If another controllable is on land the unit / controllable will orbit around.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param Controllable#CONTROLLABLE FollowControllable The controllable to be followed.
|
-- @param Wrapper.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 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 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 )
|
function CONTROLLABLE:TaskFollow( FollowControllable, Vec3, LastWaypointIndex )
|
||||||
self:F2( { self.ControllableName, 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 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.
|
-- The unit / controllable will also protect that controllable from threats of specified types.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param Controllable#CONTROLLABLE EscortControllable The controllable to be escorted.
|
-- @param Wrapper.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 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 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 #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.
|
-- @param Dcs.DCSTypes#AttributeNameArray TargetTypes Array of AttributeName that is contains threat categories allowed to engage.
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes )
|
function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSTypes#Vec2 Vec2 The point to fire at.
|
-- @param Dcs.DCSTypes#Vec2 Vec2 The point to fire at.
|
||||||
-- @param DCSTypes#Distance Radius The radius of the zone to deploy the fire at.
|
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone to deploy the fire at.
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius )
|
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius )
|
||||||
self:F2( { self.ControllableName, Vec2, Radius } )
|
self:F2( { self.ControllableName, Vec2, Radius } )
|
||||||
|
|
||||||
@ -911,7 +911,7 @@ end
|
|||||||
|
|
||||||
--- (GROUND) Hold ground controllable from moving.
|
--- (GROUND) Hold ground controllable from moving.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:TaskHold()
|
function CONTROLLABLE:TaskHold()
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
@ -938,11 +938,11 @@ end
|
|||||||
-- The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.
|
-- 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.
|
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #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.
|
-- @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 )
|
function CONTROLLABLE:TaskFAC_AttackGroup( AttackGroup, WeaponType, Designation, Datalink )
|
||||||
self:F2( { self.ControllableName, AttackGroup, WeaponType, Designation, Datalink } )
|
self:F2( { self.ControllableName, AttackGroup, WeaponType, Designation, Datalink } )
|
||||||
|
|
||||||
@ -974,10 +974,10 @@ end
|
|||||||
|
|
||||||
--- (AIR) Engaging targets of defined types.
|
--- (AIR) Engaging targets of defined types.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 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 DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
-- @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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskEngageTargets( Distance, TargetTypes, Priority )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Engaging a targets of defined types at circle-shaped zone.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCSTypes#Vec2 Vec2 2D-coordinates of the zone.
|
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the zone.
|
||||||
-- @param DCSTypes#Distance Radius Radius of the zone.
|
-- @param Dcs.DCSTypes#Distance Radius Radius of the zone.
|
||||||
-- @param DCSTypes#AttributeNameArray TargetTypes Array of target categories allowed to engage.
|
-- @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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskEngageTargets( Vec2, Radius, TargetTypes, Priority )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (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 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 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 #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 #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 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#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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Attack the Unit.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 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 #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 #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 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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskEngageUnit( AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:EnRouteTaskAWACS( )
|
function CONTROLLABLE:EnRouteTaskAWACS( )
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
@ -1174,7 +1174,7 @@ end
|
|||||||
|
|
||||||
--- (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
--- (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:EnRouteTaskTanker( )
|
function CONTROLLABLE:EnRouteTaskTanker( )
|
||||||
self:F2( { self.ControllableName } )
|
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.
|
--- (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
|
-- @param #CONTROLLABLE self
|
||||||
-- @return DCSTask#Task The DCS task structure.
|
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||||
function CONTROLLABLE:EnRouteTaskEWR( )
|
function CONTROLLABLE:EnRouteTaskEWR( )
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
@ -1226,12 +1226,12 @@ end
|
|||||||
-- The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.
|
-- 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.
|
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 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 #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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponType, Designation, Datalink )
|
||||||
self:F2( { self.ControllableName, AttackGroup, WeaponType, Priority, 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.
|
-- 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.
|
-- If the task is assigned to the controllable lead unit will be a FAC.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @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 )
|
function CONTROLLABLE:EnRouteTaskFAC( Radius, Priority )
|
||||||
self:F2( { self.ControllableName, 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.
|
--- (AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #number Duration The duration in seconds to wait.
|
||||||
-- @param #CONTROLLABLE EmbarkingControllable The controllable to be embarked.
|
-- @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 )
|
function CONTROLLABLE:TaskEmbarking( Point, Duration, EmbarkingControllable )
|
||||||
self:F2( { self.ControllableName, Point, Duration, EmbarkingControllable.DCSControllable } )
|
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.
|
--- Move to a defined Vec2 Point, and embark to a controllable when arrived within a defined Radius.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @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 )
|
function CONTROLLABLE:TaskEmbarkToTransport( Point, Radius )
|
||||||
self:F2( { self.ControllableName, Point, Radius } )
|
self:F2( { self.ControllableName, Point, Radius } )
|
||||||
|
|
||||||
local DCSTask --DCSTask#Task
|
local DCSTask --Dcs.DCSTasking.Task#Task
|
||||||
DCSTask = { id = 'EmbarkToTransport',
|
DCSTask = { id = 'EmbarkToTransport',
|
||||||
params = { x = Point.x,
|
params = { x = Point.x,
|
||||||
y = Point.y,
|
y = Point.y,
|
||||||
@ -1347,7 +1347,7 @@ end
|
|||||||
--- (AIR + GROUND) Return a mission task from a mission template.
|
--- (AIR + GROUND) Return a mission task from a mission template.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #table TaskMission A table containing the mission task.
|
-- @param #table TaskMission A table containing the mission task.
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskMission( TaskMission )
|
function CONTROLLABLE:TaskMission( TaskMission )
|
||||||
self:F2( Points )
|
self:F2( Points )
|
||||||
|
|
||||||
@ -1361,7 +1361,7 @@ end
|
|||||||
--- Return a Misson task to follow a given route defined by Points.
|
--- Return a Misson task to follow a given route defined by Points.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #table Points A table of route points.
|
-- @param #table Points A table of route points.
|
||||||
-- @return DCSTask#Task
|
-- @return Dcs.DCSTasking.Task#Task
|
||||||
function CONTROLLABLE:TaskRoute( Points )
|
function CONTROLLABLE:TaskRoute( Points )
|
||||||
self:F2( Points )
|
self:F2( Points )
|
||||||
|
|
||||||
@ -1374,7 +1374,7 @@ end
|
|||||||
|
|
||||||
--- (AIR + GROUND) Make the Controllable move to fly to a given point.
|
--- (AIR + GROUND) Make the Controllable move to fly to a given point.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @param #number Speed The speed to travel.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:TaskRouteToVec2( Point, Speed )
|
function CONTROLLABLE:TaskRouteToVec2( Point, Speed )
|
||||||
@ -1425,7 +1425,7 @@ end
|
|||||||
|
|
||||||
--- (AIR + GROUND) Make the Controllable move to a given point.
|
--- (AIR + GROUND) Make the Controllable move to a given point.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @param #number Speed The speed to travel.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:TaskRouteToVec3( Point, Speed )
|
function CONTROLLABLE:TaskRouteToVec3( Point, Speed )
|
||||||
@ -1508,7 +1508,7 @@ end
|
|||||||
-- A speed can be given in km/h.
|
-- A speed can be given in km/h.
|
||||||
-- A given formation can be given.
|
-- A given formation can be given.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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 #boolean Randomize Defines whether to target point gets randomized within the Zone.
|
||||||
-- @param #number Speed The speed.
|
-- @param #number Speed The speed.
|
||||||
-- @param Base#FORMATION Formation The formation string.
|
-- @param Base#FORMATION Formation The formation string.
|
||||||
@ -1566,11 +1566,11 @@ function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
|||||||
return nil
|
return nil
|
||||||
end
|
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 speed can be given in km/h.
|
||||||
-- A given formation can be given.
|
-- A given formation can be given.
|
||||||
-- @param #CONTROLLABLE self
|
-- @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.
|
-- @param #number Speed (optional) The speed.
|
||||||
-- @return #string The route
|
-- @return #string The route
|
||||||
function CONTROLLABLE:RouteReturnToAirbase( ReturnAirbase, Speed )
|
function CONTROLLABLE:RouteReturnToAirbase( ReturnAirbase, Speed )
|
||||||
@ -1690,7 +1690,7 @@ function CONTROLLABLE:GetTaskRoute()
|
|||||||
return routines.utils.deepCopy( _DATABASE.Templates.Controllables[self.ControllableName].Template.route.points )
|
return routines.utils.deepCopy( _DATABASE.Templates.Controllables[self.ControllableName].Template.route.points )
|
||||||
end
|
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 #CONTROLLABLE self
|
||||||
-- @param #number Begin The route point from where the copy will start. The base route point is 0.
|
-- @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.
|
-- @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.
|
--- Return the detected targets of the controllable.
|
||||||
-- The optional parametes specify the detection methods that can be applied.
|
-- 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.
|
-- 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 DetectVisual (optional)
|
||||||
-- @param #boolean DetectOptical (optional)
|
-- @param #boolean DetectOptical (optional)
|
||||||
-- @param #boolean DetectRadar (optional)
|
-- @param #boolean DetectRadar (optional)
|
||||||
@ -1814,8 +1814,8 @@ function CONTROLLABLE:OptionROEHoldFirePossible()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Holding weapons.
|
--- Holding weapons.
|
||||||
-- @param Controllable#CONTROLLABLE self
|
-- @param Wrapper.Controllable#CONTROLLABLE self
|
||||||
-- @return Controllable#CONTROLLABLE self
|
-- @return Wrapper.Controllable#CONTROLLABLE self
|
||||||
function CONTROLLABLE:OptionROEHoldFire()
|
function CONTROLLABLE:OptionROEHoldFire()
|
||||||
self:F2( { self.ControllableName } )
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
@ -2115,7 +2115,7 @@ function CONTROLLABLE:OptionROTVertical()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
|
--- 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.
|
-- 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!
|
-- Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED!
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
@ -2206,8 +2206,8 @@ end
|
|||||||
--- Returns a message with the callsign embedded (if there is one).
|
--- Returns a message with the callsign embedded (if there is one).
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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.
|
||||||
-- @return Message#MESSAGE
|
-- @return Core.Message#MESSAGE
|
||||||
function CONTROLLABLE:GetMessage( Message, Duration )
|
function CONTROLLABLE:GetMessage( Message, Duration )
|
||||||
|
|
||||||
local DCSObject = self:GetDCSObject()
|
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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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 )
|
function CONTROLLABLE:MessageToAll( Message, Duration )
|
||||||
self:F2( { 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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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 )
|
function CONTROLLABLE:MessageToRed( Message, Duration )
|
||||||
self:F2( { 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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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 )
|
function CONTROLLABLE:MessageToBlue( Message, Duration )
|
||||||
self:F2( { 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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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.
|
||||||
-- @param Client#CLIENT Client The client object receiving the message.
|
-- @param Wrapper.Client#CLIENT Client The client object receiving the message.
|
||||||
function CONTROLLABLE:MessageToClient( Message, Duration, Client )
|
function CONTROLLABLE:MessageToClient( Message, Duration, Client )
|
||||||
self:F2( { Message, Duration } )
|
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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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.
|
||||||
-- @param Group#GROUP MessageGroup The GROUP object receiving the message.
|
-- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message.
|
||||||
function CONTROLLABLE:MessageToGroup( Message, Duration, MessageGroup )
|
function CONTROLLABLE:MessageToGroup( Message, Duration, MessageGroup )
|
||||||
self:F2( { Message, Duration } )
|
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.
|
-- 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 #CONTROLLABLE self
|
||||||
-- @param #string Message The message text
|
-- @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 )
|
function CONTROLLABLE:Message( Message, Duration )
|
||||||
self:F2( { Message, Duration } )
|
self:F2( { Message, Duration } )
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
--- This module contains the GROUP class.
|
--- 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.
|
-- * Support all DCS Group APIs.
|
||||||
-- * Enhance with Group specific APIs not in the DCS Group API set.
|
-- * 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.
|
-- 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
|
-- 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.
|
-- 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.
|
-- 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.
|
-- 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:
|
-- Find below a list of the **assigned task** methods:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskAttackGroup}: (AIR) Attack a Group.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackGroup}: (AIR) Attack a Group.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskAttackUnit}: (AIR) Attack the Unit.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackUnit}: (AIR) Attack the Unit.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskBombing}: (Controllable#CONTROLLABLEDelivering weapon at the point on the ground.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskBombing}: (Wrapper.Controllable#CONTROLLABLEDelivering weapon at the point on the ground.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskBombingRunway}: (AIR) Delivering weapon on the runway.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne group.
|
-- * @{Wrapper.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.
|
-- * @{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.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne group.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne group.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskHold}: (GROUND) Hold ground group from moving.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the group at a @{Zone#ZONE_RADIUS).
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the group at a @{Core.Zone#ZONE_RADIUS).
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.
|
-- * @{Wrapper.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.TaskReturnToBase}: (AIR) Route the group to an airbase.
|
||||||
--
|
--
|
||||||
-- ### 1.2.2) EnRoute task methods
|
-- ### 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:
|
-- 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.
|
-- * @{Wrapper.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.
|
-- * @{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.
|
||||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
||||||
-- * @{Controllable#CONTROLLABLE.EnRouteTaskEWR}: (AIR) Attack the Unit.
|
-- * @{Wrapper.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.
|
-- * @{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.
|
||||||
-- * @{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.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.EnRouteTaskTanker}: (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||||
--
|
--
|
||||||
-- ### 1.2.3) Preparation task methods
|
-- ### 1.2.3) Preparation task methods
|
||||||
--
|
--
|
||||||
-- There are certain task methods that allow to tailor the task behaviour:
|
-- There are certain task methods that allow to tailor the task behaviour:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
||||||
-- * @{Controllable#CONTROLLABLE.TaskCondition}: Return a condition section for a controlled task.
|
-- * @{Wrapper.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.TaskControlled}: Return a Controlled Task taking a Task and a TaskCondition.
|
||||||
--
|
--
|
||||||
-- ### 1.2.4) Obtain the mission from group templates
|
-- ### 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:
|
-- 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
|
-- 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.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandDoScript}: Do Script command.
|
||||||
-- * @{Controllable#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
||||||
--
|
--
|
||||||
-- 1.4) GROUP Option methods
|
-- 1.4) GROUP Option methods
|
||||||
-- -------------------------
|
-- -------------------------
|
||||||
@ -108,31 +108,31 @@
|
|||||||
--
|
--
|
||||||
-- ### 1.4.1) Rule of Engagement:
|
-- ### 1.4.1) Rule of Engagement:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEWeaponFree}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFree}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEOpenFire}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFire}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEReturnFire}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFire}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEEvadeFire}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFire}
|
||||||
--
|
--
|
||||||
-- To check whether an ROE option is valid for a specific group, use:
|
-- To check whether an ROE option is valid for a specific group, use:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEWeaponFreePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFreePossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEOpenFirePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFirePossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEReturnFirePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFirePossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROEEvadeFirePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFirePossible}
|
||||||
--
|
--
|
||||||
-- ### 1.4.2) Rule on thread:
|
-- ### 1.4.2) Rule on thread:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTNoReaction}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReaction}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTPassiveDefense}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefense}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTEvadeFire}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFire}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTVertical}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVertical}
|
||||||
--
|
--
|
||||||
-- To test whether an ROT option is valid for a specific group, use:
|
-- To test whether an ROT option is valid for a specific group, use:
|
||||||
--
|
--
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTNoReactionPossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReactionPossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTPassiveDefensePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefensePossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTEvadeFirePossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFirePossible}
|
||||||
-- * @{Controllable#CONTROLLABLE.OptionROTVerticalPossible}
|
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVerticalPossible}
|
||||||
--
|
--
|
||||||
-- 1.5) GROUP Zone validation methods
|
-- 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.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}.
|
-- * @{#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
|
-- @module Group
|
||||||
-- @author FlightControl
|
-- @author FlightControl
|
||||||
|
|
||||||
--- The GROUP class
|
--- The GROUP class
|
||||||
-- @type GROUP
|
-- @type GROUP
|
||||||
-- @extends Controllable#CONTROLLABLE
|
-- @extends Wrapper.Controllable#CONTROLLABLE
|
||||||
-- @field #string GroupName The name of the group.
|
-- @field #string GroupName The name of the group.
|
||||||
GROUP = {
|
GROUP = {
|
||||||
ClassName = "GROUP",
|
ClassName = "GROUP",
|
||||||
@ -158,7 +158,7 @@ GROUP = {
|
|||||||
|
|
||||||
--- Create a new GROUP from a DCSGroup
|
--- Create a new GROUP from a DCSGroup
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param DCSGroup#Group GroupName The DCS Group name
|
-- @param Dcs.DCSWrapper.Group#Group GroupName The DCS Group name
|
||||||
-- @return #GROUP self
|
-- @return #GROUP self
|
||||||
function GROUP:Register( GroupName )
|
function GROUP:Register( GroupName )
|
||||||
local self = BASE:Inherit( self, CONTROLLABLE:New( GroupName ) )
|
local self = BASE:Inherit( self, CONTROLLABLE:New( GroupName ) )
|
||||||
@ -171,11 +171,11 @@ end
|
|||||||
|
|
||||||
--- Find the GROUP wrapper class instance using the DCS Group.
|
--- Find the GROUP wrapper class instance using the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param DCSGroup#Group DCSGroup The DCS Group.
|
-- @param Dcs.DCSWrapper.Group#Group DCSGroup The DCS Group.
|
||||||
-- @return #GROUP The GROUP.
|
-- @return #GROUP The GROUP.
|
||||||
function GROUP:Find( DCSGroup )
|
function GROUP:Find( DCSGroup )
|
||||||
|
|
||||||
local GroupName = DCSGroup:getName() -- Group#GROUP
|
local GroupName = DCSGroup:getName() -- Wrapper.Group#GROUP
|
||||||
local GroupFound = _DATABASE:FindGroup( GroupName )
|
local GroupFound = _DATABASE:FindGroup( GroupName )
|
||||||
return GroupFound
|
return GroupFound
|
||||||
end
|
end
|
||||||
@ -194,7 +194,7 @@ end
|
|||||||
|
|
||||||
--- Returns the DCS Group.
|
--- Returns the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @return DCSGroup#Group The DCS Group.
|
-- @return Dcs.DCSWrapper.Group#Group The DCS Group.
|
||||||
function GROUP:GetDCSObject()
|
function GROUP:GetDCSObject()
|
||||||
local DCSGroup = Group.getByName( self.GroupName )
|
local DCSGroup = Group.getByName( self.GroupName )
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ end
|
|||||||
|
|
||||||
--- Returns category of the DCS Group.
|
--- Returns category of the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @return DCSGroup#Group.Category The category ID
|
-- @return Dcs.DCSWrapper.Group#Group.Category The category ID
|
||||||
function GROUP:GetCategory()
|
function GROUP:GetCategory()
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ end
|
|||||||
|
|
||||||
--- Returns the coalition of the DCS Group.
|
--- Returns the coalition of the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @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()
|
function GROUP:GetCoalition()
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ end
|
|||||||
|
|
||||||
--- Returns the country of the DCS Group.
|
--- Returns the country of the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @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.
|
-- @return #nil The DCS Group is not existing or alive.
|
||||||
function GROUP:GetCountry()
|
function GROUP:GetCountry()
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
@ -321,7 +321,7 @@ end
|
|||||||
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param #number UnitNumber The number of the UNIT wrapper class to be returned.
|
-- @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 )
|
function GROUP:GetUnit( UnitNumber )
|
||||||
self:F2( { self.GroupName, UnitNumber } )
|
self:F2( { self.GroupName, UnitNumber } )
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ end
|
|||||||
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param #number UnitNumber The number of the DCS Unit to be returned.
|
-- @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 )
|
function GROUP:GetDCSUnit( UnitNumber )
|
||||||
self:F2( { self.GroupName, 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.
|
--- Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group.
|
||||||
-- @param #GROUP self
|
-- @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()
|
function GROUP:GetVec2()
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
|
|
||||||
@ -486,7 +486,7 @@ function GROUP:GetVec2()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the current Vec3 vector of the first DCS Unit in the GROUP.
|
--- 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()
|
function GROUP:GetVec3()
|
||||||
self:F2( self.GroupName )
|
self:F2( self.GroupName )
|
||||||
|
|
||||||
@ -501,13 +501,13 @@ end
|
|||||||
|
|
||||||
--- Returns true if all units of the group are within a @{Zone}.
|
--- Returns true if all units of the group are within a @{Zone}.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||||
function GROUP:IsCompletelyInZone( Zone )
|
function GROUP:IsCompletelyInZone( Zone )
|
||||||
self:F2( { self.GroupName, Zone } )
|
self:F2( { self.GroupName, Zone } )
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local Unit = UnitData -- Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
-- TODO: Rename IsPointVec3InZone to IsVec3InZone
|
-- TODO: Rename IsPointVec3InZone to IsVec3InZone
|
||||||
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||||
else
|
else
|
||||||
@ -520,13 +520,13 @@ end
|
|||||||
|
|
||||||
--- Returns true if some units of the group are within a @{Zone}.
|
--- Returns true if some units of the group are within a @{Zone}.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||||
function GROUP:IsPartlyInZone( Zone )
|
function GROUP:IsPartlyInZone( Zone )
|
||||||
self:F2( { self.GroupName, Zone } )
|
self:F2( { self.GroupName, Zone } )
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
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
|
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -537,13 +537,13 @@ end
|
|||||||
|
|
||||||
--- Returns true if none of the group units of the group are within a @{Zone}.
|
--- Returns true if none of the group units of the group are within a @{Zone}.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
-- @return #boolean Returns true if the Group is completely within the @{Core.Zone#ZONE_BASE}
|
||||||
function GROUP:IsNotInZone( Zone )
|
function GROUP:IsNotInZone( Zone )
|
||||||
self:F2( { self.GroupName, Zone } )
|
self:F2( { self.GroupName, Zone } )
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
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
|
if Zone:IsPointVec3InZone( Unit:GetVec3() ) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -712,7 +712,7 @@ end
|
|||||||
-- SPAWNING
|
-- SPAWNING
|
||||||
|
|
||||||
--- Respawn the @{GROUP} using a (tweaked) template of the Group.
|
--- 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.
|
-- The template contains all the definitions as declared within the mission file.
|
||||||
-- To understand templates, do the following:
|
-- 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.
|
-- * 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.
|
-- * Then it will destroy the current alive group.
|
||||||
-- * And it will respawn the group using your new template definition.
|
-- * 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()
|
-- @param #table Template The template of the Group retrieved with GROUP:GetTemplate()
|
||||||
function GROUP:Respawn( Template )
|
function GROUP:Respawn( Template )
|
||||||
|
|
||||||
@ -740,7 +740,7 @@ function GROUP:Respawn( Template )
|
|||||||
|
|
||||||
self:E( #Template.units )
|
self:E( #Template.units )
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local GroupUnit = UnitData -- Unit#UNIT
|
local GroupUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
self:E( GroupUnit:GetName() )
|
self:E( GroupUnit:GetName() )
|
||||||
if GroupUnit:IsAlive() then
|
if GroupUnit:IsAlive() then
|
||||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||||
@ -777,7 +777,7 @@ end
|
|||||||
|
|
||||||
--- Sets the CountryID of the group in a Template.
|
--- Sets the CountryID of the group in a Template.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param DCScountry#country.id CountryID The country ID.
|
-- @param Dcs.DCScountry#country.id CountryID The country ID.
|
||||||
-- @return #table
|
-- @return #table
|
||||||
function GROUP:SetTemplateCountry( Template, CountryID )
|
function GROUP:SetTemplateCountry( Template, CountryID )
|
||||||
Template.CountryID = CountryID
|
Template.CountryID = CountryID
|
||||||
@ -786,7 +786,7 @@ end
|
|||||||
|
|
||||||
--- Sets the CoalitionID of the group in a Template.
|
--- Sets the CoalitionID of the group in a Template.
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
-- @param DCSCoalitionObject#coalition.side CoalitionID The coalition ID.
|
-- @param Dcs.DCSCoalitionWrapper.Object#coalition.side CoalitionID The coalition ID.
|
||||||
-- @return #table
|
-- @return #table
|
||||||
function GROUP:SetTemplateCoalition( Template, CoalitionID )
|
function GROUP:SetTemplateCoalition( Template, CoalitionID )
|
||||||
Template.CoalitionID = CoalitionID
|
Template.CoalitionID = CoalitionID
|
||||||
@ -814,7 +814,7 @@ function GROUP:GetTaskRoute()
|
|||||||
return routines.utils.deepCopy( _DATABASE.Templates.Groups[self.GroupName].Template.route.points )
|
return routines.utils.deepCopy( _DATABASE.Templates.Groups[self.GroupName].Template.route.points )
|
||||||
end
|
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 #GROUP self
|
||||||
-- @param #number Begin The route point from where the copy will start. The base route point is 0.
|
-- @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.
|
-- @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.
|
--- 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:
|
-- 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
|
--- Create a new IDENTIFIABLE from a DCSIdentifiable
|
||||||
-- @param #IDENTIFIABLE self
|
-- @param #IDENTIFIABLE self
|
||||||
-- @param DCSIdentifiable#Identifiable IdentifiableName The DCS Identifiable name
|
-- @param Dcs.DCSWrapper.Identifiable#Identifiable IdentifiableName The DCS Identifiable name
|
||||||
-- @return #IDENTIFIABLE self
|
-- @return #IDENTIFIABLE self
|
||||||
function IDENTIFIABLE:New( IdentifiableName )
|
function IDENTIFIABLE:New( IdentifiableName )
|
||||||
local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) )
|
local self = BASE:Inherit( self, OBJECT:New( IdentifiableName ) )
|
||||||
@ -121,7 +121,7 @@ end
|
|||||||
|
|
||||||
--- Returns category of the DCS Identifiable.
|
--- Returns category of the DCS Identifiable.
|
||||||
-- @param #IDENTIFIABLE self
|
-- @param #IDENTIFIABLE self
|
||||||
-- @return DCSObject#Object.Category The category ID
|
-- @return Dcs.DCSWrapper.Object#Object.Category The category ID
|
||||||
function IDENTIFIABLE:GetCategory()
|
function IDENTIFIABLE:GetCategory()
|
||||||
self:F2( self.ObjectName )
|
self:F2( self.ObjectName )
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ end
|
|||||||
|
|
||||||
--- Returns coalition of the Identifiable.
|
--- Returns coalition of the Identifiable.
|
||||||
-- @param #IDENTIFIABLE self
|
-- @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.
|
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||||
function IDENTIFIABLE:GetCoalition()
|
function IDENTIFIABLE:GetCoalition()
|
||||||
self:F2( self.IdentifiableName )
|
self:F2( self.IdentifiableName )
|
||||||
@ -172,7 +172,7 @@ end
|
|||||||
|
|
||||||
--- Returns country of the Identifiable.
|
--- Returns country of the Identifiable.
|
||||||
-- @param #IDENTIFIABLE self
|
-- @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.
|
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||||
function IDENTIFIABLE:GetCountry()
|
function IDENTIFIABLE:GetCountry()
|
||||||
self:F2( self.IdentifiableName )
|
self:F2( self.IdentifiableName )
|
||||||
@ -193,7 +193,7 @@ end
|
|||||||
|
|
||||||
--- Returns Identifiable descriptor. Descriptor type depends on Identifiable category.
|
--- Returns Identifiable descriptor. Descriptor type depends on Identifiable category.
|
||||||
-- @param #IDENTIFIABLE self
|
-- @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.
|
-- @return #nil The DCS Identifiable is not existing or alive.
|
||||||
function IDENTIFIABLE:GetDesc()
|
function IDENTIFIABLE:GetDesc()
|
||||||
self:F2( self.IdentifiableName )
|
self:F2( self.IdentifiableName )
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
--- This module contains the OBJECT class.
|
--- 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.
|
-- * Support all DCS Object APIs.
|
||||||
-- * Enhance with Object specific APIs not in the DCS Object API set.
|
-- * 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:
|
-- 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:
|
-- 1.2) OBJECT methods:
|
||||||
-- --------------------------
|
-- --------------------------
|
||||||
-- The following methods can be used to identify an Object object:
|
-- 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
|
--- Create a new OBJECT from a DCSObject
|
||||||
-- @param #OBJECT self
|
-- @param #OBJECT self
|
||||||
-- @param DCSObject#Object ObjectName The Object name
|
-- @param Dcs.DCSWrapper.Object#Object ObjectName The Object name
|
||||||
-- @return #OBJECT self
|
-- @return #OBJECT self
|
||||||
function OBJECT:New( ObjectName )
|
function OBJECT:New( ObjectName )
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
@ -52,8 +52,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Returns the unit's unique identifier.
|
--- Returns the unit's unique identifier.
|
||||||
-- @param Object#OBJECT self
|
-- @param Wrapper.Object#OBJECT self
|
||||||
-- @return DCSObject#Object.ID ObjectID
|
-- @return Dcs.DCSWrapper.Object#Object.ID ObjectID
|
||||||
-- @return #nil The DCS Object is not existing or alive.
|
-- @return #nil The DCS Object is not existing or alive.
|
||||||
function OBJECT:GetID()
|
function OBJECT:GetID()
|
||||||
self:F2( self.ObjectName )
|
self:F2( self.ObjectName )
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
--- This module contains the POSITIONABLE class.
|
--- 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.
|
-- * Support all DCS APIs.
|
||||||
-- * Enhance with POSITIONABLE specific APIs not in the DCS API set.
|
-- * 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:
|
-- 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:
|
-- 1.2) POSITIONABLE methods:
|
||||||
-- --------------------------
|
-- --------------------------
|
||||||
-- The following methods can be used to identify an measurable object:
|
-- The following methods can be used to identify an measurable object:
|
||||||
--
|
--
|
||||||
-- * @{Positionable#POSITIONABLE.GetID}(): Returns the ID of the measurable object.
|
-- * @{Wrapper.Positionable#POSITIONABLE.GetID}(): Returns the ID of the measurable object.
|
||||||
-- * @{Positionable#POSITIONABLE.GetName}(): Returns the name 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
|
--- Create a new POSITIONABLE from a DCSPositionable
|
||||||
-- @param #POSITIONABLE self
|
-- @param #POSITIONABLE self
|
||||||
-- @param DCSPositionable#Positionable PositionableName The POSITIONABLE name
|
-- @param Dcs.DCSWrapper.Positionable#Positionable PositionableName The POSITIONABLE name
|
||||||
-- @return #POSITIONABLE self
|
-- @return #POSITIONABLE self
|
||||||
function POSITIONABLE:New( PositionableName )
|
function POSITIONABLE:New( PositionableName )
|
||||||
local self = BASE:Inherit( self, IDENTIFIABLE:New( PositionableName ) )
|
local self = BASE:Inherit( self, IDENTIFIABLE:New( PositionableName ) )
|
||||||
@ -49,9 +49,9 @@ function POSITIONABLE:New( PositionableName )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.
|
--- Returns the @{Dcs.DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
-- @return Dcs.DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetPositionVec3()
|
function POSITIONABLE:GetPositionVec3()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -67,9 +67,9 @@ function POSITIONABLE:GetPositionVec3()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the POSITIONABLE within the mission.
|
--- Returns the @{Dcs.DCSTypes#Vec2} vector indicating the point in 2D of the POSITIONABLE within the mission.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Vec2 The 2D point vector of the POSITIONABLE.
|
-- @return Dcs.DCSTypes#Vec2 The 2D point vector of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetVec2()
|
function POSITIONABLE:GetVec2()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -91,8 +91,8 @@ function POSITIONABLE:GetVec2()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
|
--- Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
|
-- @return Core.Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetPointVec2()
|
function POSITIONABLE:GetPointVec2()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -112,9 +112,9 @@ function POSITIONABLE:GetPointVec2()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Returns a random @{DCSTypes#Vec3} vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
|
--- Returns a random @{Dcs.DCSTypes#Vec3} vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
-- @return Dcs.DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetRandomVec3( Radius )
|
function POSITIONABLE:GetRandomVec3( Radius )
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -136,9 +136,9 @@ function POSITIONABLE:GetRandomVec3( Radius )
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the @{DCSTypes#Vec3} vector indicating the 3D vector of the POSITIONABLE within the mission.
|
--- Returns the @{Dcs.DCSTypes#Vec3} vector indicating the 3D vector of the POSITIONABLE within the mission.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
-- @return Dcs.DCSTypes#Vec3 The 3D point vector of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetVec3()
|
function POSITIONABLE:GetVec3()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -155,8 +155,8 @@ function POSITIONABLE:GetVec3()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the altitude of the POSITIONABLE.
|
--- Returns the altitude of the POSITIONABLE.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Distance The altitude of the POSITIONABLE.
|
-- @return Dcs.DCSTypes#Distance The altitude of the POSITIONABLE.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetAltitude()
|
function POSITIONABLE:GetAltitude()
|
||||||
self:F2()
|
self:F2()
|
||||||
@ -164,7 +164,7 @@ function POSITIONABLE:GetAltitude()
|
|||||||
local DCSPositionable = self:GetDCSObject()
|
local DCSPositionable = self:GetDCSObject()
|
||||||
|
|
||||||
if DCSPositionable then
|
if DCSPositionable then
|
||||||
local PositionablePointVec3 = DCSPositionable:getPoint() --DCSTypes#Vec3
|
local PositionablePointVec3 = DCSPositionable:getPoint() --Dcs.DCSTypes#Vec3
|
||||||
return PositionablePointVec3.y
|
return PositionablePointVec3.y
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ function POSITIONABLE:GetAltitude()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Returns if the Positionable is located above a runway.
|
--- 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 #boolean true if Positionable is above a runway.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:IsAboveRunway()
|
function POSITIONABLE:IsAboveRunway()
|
||||||
@ -196,7 +196,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Returns the POSITIONABLE heading in degrees.
|
--- Returns the POSITIONABLE heading in degrees.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return #number The POSTIONABLE heading
|
-- @return #number The POSTIONABLE heading
|
||||||
function POSITIONABLE:GetHeading()
|
function POSITIONABLE:GetHeading()
|
||||||
local DCSPositionable = self:GetDCSObject()
|
local DCSPositionable = self:GetDCSObject()
|
||||||
@ -220,7 +220,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Returns true if the POSITIONABLE is in the air.
|
--- 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 #boolean true if in the air.
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:InAir()
|
function POSITIONABLE:InAir()
|
||||||
@ -239,8 +239,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Returns the POSITIONABLE velocity vector.
|
--- Returns the POSITIONABLE velocity vector.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return DCSTypes#Vec3 The velocity vector
|
-- @return Dcs.DCSTypes#Vec3 The velocity vector
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetVelocity()
|
function POSITIONABLE:GetVelocity()
|
||||||
self:F2( self.PositionableName )
|
self:F2( self.PositionableName )
|
||||||
@ -257,7 +257,7 @@ function POSITIONABLE:GetVelocity()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the POSITIONABLE velocity in km/h.
|
--- Returns the POSITIONABLE velocity in km/h.
|
||||||
-- @param Positionable#POSITIONABLE self
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||||
-- @return #number The velocity in km/h
|
-- @return #number The velocity in km/h
|
||||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||||
function POSITIONABLE:GetVelocityKMH()
|
function POSITIONABLE:GetVelocityKMH()
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
--- This module contains the STATIC class.
|
--- 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.
|
-- 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.
|
-- 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.
|
-- * Wraps the DCS Static objects.
|
||||||
-- * Support all DCS Static APIs.
|
-- * Support all DCS Static APIs.
|
||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
--- The STATIC class
|
--- The STATIC class
|
||||||
-- @type STATIC
|
-- @type STATIC
|
||||||
-- @extends Positionable#POSITIONABLE
|
-- @extends Wrapper.Positionable#POSITIONABLE
|
||||||
STATIC = {
|
STATIC = {
|
||||||
ClassName = "STATIC",
|
ClassName = "STATIC",
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
--- This module contains the UNIT class.
|
--- 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:
|
-- 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.
|
-- 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,
|
-- 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}().
|
-- is implemented in the UNIT class as @{#UNIT.GetName}().
|
||||||
--
|
--
|
||||||
-- 1.3) Smoke, Flare Units
|
-- 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.
|
-- The UNIT class contains methods to test the location or proximity against zones or other objects.
|
||||||
--
|
--
|
||||||
-- ### 1.6.1) Zones
|
-- ### 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
|
-- ### 1.6.2) Units
|
||||||
-- Test if another DCS Unit is within a given radius of the current DCS Unit, use the @{#UNIT.OtherUnitInRadius}() method.
|
-- 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.
|
--- Finds a UNIT from the _DATABASE using a DCSUnit object.
|
||||||
-- @param #UNIT self
|
-- @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
|
-- @return #UNIT self
|
||||||
function UNIT:Find( DCSUnit )
|
function UNIT:Find( DCSUnit )
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- @param #UNIT self
|
--- @param #UNIT self
|
||||||
-- @return DCSUnit#Unit
|
-- @return Dcs.DCSWrapper.Unit#Unit
|
||||||
function UNIT:GetDCSObject()
|
function UNIT:GetDCSObject()
|
||||||
|
|
||||||
local DCSUnit = Unit.getByName( self.UnitName )
|
local DCSUnit = Unit.getByName( self.UnitName )
|
||||||
@ -183,7 +183,7 @@ end
|
|||||||
-- * Then it will respawn the re-modelled group.
|
-- * Then it will respawn the re-modelled group.
|
||||||
--
|
--
|
||||||
-- @param #UNIT self
|
-- @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.
|
-- @param #number Heading The heading of the unit respawn.
|
||||||
function UNIT:ReSpawn( SpawnVec3, Heading )
|
function UNIT:ReSpawn( SpawnVec3, Heading )
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ end
|
|||||||
|
|
||||||
--- Returns the Unit's ammunition.
|
--- Returns the Unit's ammunition.
|
||||||
-- @param #UNIT self
|
-- @param #UNIT self
|
||||||
-- @return DCSUnit#Unit.Ammo
|
-- @return Dcs.DCSWrapper.Unit#Unit.Ammo
|
||||||
-- @return #nil The DCS Unit is not existing or alive.
|
-- @return #nil The DCS Unit is not existing or alive.
|
||||||
function UNIT:GetAmmo()
|
function UNIT:GetAmmo()
|
||||||
self:F2( self.UnitName )
|
self:F2( self.UnitName )
|
||||||
@ -400,7 +400,7 @@ end
|
|||||||
|
|
||||||
--- Returns the unit sensors.
|
--- Returns the unit sensors.
|
||||||
-- @param #UNIT self
|
-- @param #UNIT self
|
||||||
-- @return DCSUnit#Unit.Sensors
|
-- @return Dcs.DCSWrapper.Unit#Unit.Sensors
|
||||||
-- @return #nil The DCS Unit is not existing or alive.
|
-- @return #nil The DCS Unit is not existing or alive.
|
||||||
function UNIT:GetSensors()
|
function UNIT:GetSensors()
|
||||||
self:F2( self.UnitName )
|
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.
|
-- * 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
|
-- @param #UNIT self
|
||||||
-- @return #boolean Indicates if at least one of the unit's radar(s) is on.
|
-- @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.
|
-- @return #nil The DCS Unit is not existing or alive.
|
||||||
function UNIT:GetRadar()
|
function UNIT:GetRadar()
|
||||||
self:F2( self.UnitName )
|
self:F2( self.UnitName )
|
||||||
@ -591,8 +591,8 @@ end
|
|||||||
|
|
||||||
--- Returns true if the unit is within a @{Zone}.
|
--- Returns true if the unit is within a @{Zone}.
|
||||||
-- @param #UNIT self
|
-- @param #UNIT self
|
||||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||||
-- @return #boolean Returns true if the unit is within the @{Zone#ZONE_BASE}
|
-- @return #boolean Returns true if the unit is within the @{Core.Zone#ZONE_BASE}
|
||||||
function UNIT:IsInZone( Zone )
|
function UNIT:IsInZone( Zone )
|
||||||
self:F2( { self.UnitName, Zone } )
|
self:F2( { self.UnitName, Zone } )
|
||||||
|
|
||||||
@ -608,8 +608,8 @@ end
|
|||||||
|
|
||||||
--- Returns true if the unit is not within a @{Zone}.
|
--- Returns true if the unit is not within a @{Zone}.
|
||||||
-- @param #UNIT self
|
-- @param #UNIT self
|
||||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||||
-- @return #boolean Returns true if the unit is not within the @{Zone#ZONE_BASE}
|
-- @return #boolean Returns true if the unit is not within the @{Core.Zone#ZONE_BASE}
|
||||||
function UNIT:IsNotInZone( Zone )
|
function UNIT:IsNotInZone( Zone )
|
||||||
self:F2( { self.UnitName, 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.
|
--- Handle the S_EVENT_DEAD events to validate the destruction of units for the task monitoring.
|
||||||
-- @param #DESTROYBASETASK self
|
-- @param #DESTROYBASETASK self
|
||||||
-- @param Event#EVENTDATA Event structure of MOOSE.
|
-- @param Core.Event#EVENTDATA Event structure of MOOSE.
|
||||||
function DESTROYBASETASK:EventDead( Event )
|
function DESTROYBASETASK:EventDead( Event )
|
||||||
self:F( { Event } )
|
self:F( { Event } )
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,8 @@ end
|
|||||||
|
|
||||||
--- Report Goal Progress.
|
--- Report Goal Progress.
|
||||||
-- @param #DESTROYGROUPSTASK self
|
-- @param #DESTROYGROUPSTASK self
|
||||||
-- @param DCSGroup#Group DestroyGroup Group structure describing the group to be evaluated.
|
-- @param Dcs.DCSWrapper.Group#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.Unit#Unit DestroyUnit Unit structure describing the Unit to be evaluated.
|
||||||
-- @return #number The DestroyCount reflecting the amount of units destroyed within the group.
|
-- @return #number The DestroyCount reflecting the amount of units destroyed within the group.
|
||||||
function DESTROYGROUPSTASK:ReportGoalProgress( DestroyGroup, DestroyUnit )
|
function DESTROYGROUPSTASK:ReportGoalProgress( DestroyGroup, DestroyUnit )
|
||||||
self:F( { DestroyGroup, DestroyUnit, self.DestroyPercentage } )
|
self:F( { DestroyGroup, DestroyUnit, self.DestroyPercentage } )
|
||||||
|
|||||||
@ -68,9 +68,9 @@ end
|
|||||||
|
|
||||||
--- Execute
|
--- Execute
|
||||||
-- @param #STAGEBRIEF self
|
-- @param #STAGEBRIEF self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
function STAGEBRIEF:Execute( Mission, Client, Task )
|
function STAGEBRIEF:Execute( Mission, Client, Task )
|
||||||
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
||||||
@ -228,9 +228,9 @@ end
|
|||||||
|
|
||||||
--- Execute the routing.
|
--- Execute the routing.
|
||||||
-- @param #STAGEROUTE self
|
-- @param #STAGEROUTE self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
function STAGEROUTE:Execute( Mission, Client, Task )
|
function STAGEROUTE:Execute( Mission, Client, Task )
|
||||||
self:F()
|
self:F()
|
||||||
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
local Valid = BASE:Inherited(self):Execute( Mission, Client, Task )
|
||||||
@ -300,9 +300,9 @@ end
|
|||||||
|
|
||||||
--- Execute the landing coordination.
|
--- Execute the landing coordination.
|
||||||
-- @param #STAGELANDING self
|
-- @param #STAGELANDING self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
function STAGELANDING:Execute( Mission, Client, Task )
|
function STAGELANDING:Execute( Mission, Client, Task )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
@ -524,9 +524,9 @@ end
|
|||||||
|
|
||||||
--- Coordinate UnLoading
|
--- Coordinate UnLoading
|
||||||
-- @param #STAGEUNLOAD self
|
-- @param #STAGEUNLOAD self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
function STAGEUNLOAD:Execute( Mission, Client, Task )
|
function STAGEUNLOAD:Execute( Mission, Client, Task )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
@ -562,9 +562,9 @@ end
|
|||||||
|
|
||||||
--- Validate UnLoading
|
--- Validate UnLoading
|
||||||
-- @param #STAGEUNLOAD self
|
-- @param #STAGEUNLOAD self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
function STAGEUNLOAD:Validate( Mission, Client, Task )
|
function STAGEUNLOAD:Validate( Mission, Client, Task )
|
||||||
self:F()
|
self:F()
|
||||||
env.info( 'STAGEUNLOAD:Validate()' )
|
env.info( 'STAGEUNLOAD:Validate()' )
|
||||||
@ -835,9 +835,9 @@ end
|
|||||||
|
|
||||||
--- Execute Arrival
|
--- Execute Arrival
|
||||||
-- @param #STAGEARRIVE self
|
-- @param #STAGEARRIVE self
|
||||||
-- @param Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Client#CLIENT Client
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
-- @param Task#TASK Task
|
-- @param Tasking.Task#TASK Task
|
||||||
function STAGEARRIVE:Execute( Mission, Client, Task )
|
function STAGEARRIVE:Execute( Mission, Client, Task )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ do
|
|||||||
MenuStatus[MenuClientName]:Remove()
|
MenuStatus[MenuClientName]:Remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Client#CLIENT MenuClient
|
--- @param Wrapper.Client#CLIENT MenuClient
|
||||||
local function AddStatusMenu( MenuClient )
|
local function AddStatusMenu( MenuClient )
|
||||||
local MenuClientName = MenuClient:GetName()
|
local MenuClientName = MenuClient:GetName()
|
||||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||||
|
|||||||
@ -21,7 +21,7 @@ do
|
|||||||
MenuStatus[MenuGroupName]:Remove()
|
MenuStatus[MenuGroupName]:Remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param Group#GROUP MenuGroup
|
--- @param Wrapper.Group#GROUP MenuGroup
|
||||||
local function AddStatusMenu( MenuGroup )
|
local function AddStatusMenu( MenuGroup )
|
||||||
local MenuGroupName = MenuGroup:GetName()
|
local MenuGroupName = MenuGroup:GetName()
|
||||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
-- 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
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param #PROCESS_PATROLZONE self
|
-- @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.
|
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||||
function Patrol1:OnBeforeRTB( AIGroup )
|
function Patrol1:OnBeforeRTB( AIGroup )
|
||||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol1:OnAfterRTB( AIGroup )
|
function Patrol1:OnAfterRTB( AIGroup )
|
||||||
local NewGroup = PatrolSpawn:Spawn()
|
local NewGroup = PatrolSpawn:Spawn()
|
||||||
Patrol2:SetControllable( NewGroup )
|
Patrol2:SetControllable( NewGroup )
|
||||||
@ -49,23 +49,23 @@ function Patrol1:OnAfterRTB( AIGroup )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol1:OnAfterPatrol( AIGroup )
|
function Patrol1:OnAfterPatrol( AIGroup )
|
||||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param #PROCESS_PATROLZONE self
|
-- @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.
|
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||||
function Patrol2:OnBeforeRTB( AIGroup )
|
function Patrol2:OnBeforeRTB( AIGroup )
|
||||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol2:OnAfterRTB( AIGroup )
|
function Patrol2:OnAfterRTB( AIGroup )
|
||||||
local NewGroup = PatrolSpawn:Spawn()
|
local NewGroup = PatrolSpawn:Spawn()
|
||||||
Patrol1:SetControllable( NewGroup )
|
Patrol1:SetControllable( NewGroup )
|
||||||
@ -73,8 +73,8 @@ function Patrol2:OnAfterRTB( AIGroup )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param Process_PatrolZone#PROCESS_PATROLZONE self
|
-- @param Process_PatrolCore.Zone#PROCESS_PATROLZONE self
|
||||||
-- @param Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol2:OnAfterPatrol( AIGroup )
|
function Patrol2:OnAfterPatrol( AIGroup )
|
||||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,10 +7,10 @@ SetVehicles = SET_GROUP:New()
|
|||||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||||
|
|
||||||
SetVehicles:ForEachGroup(
|
SetVehicles:ForEachGroup(
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeGreen()
|
UnitAction:SmokeGreen()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -88,30 +88,30 @@ end
|
|||||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||||
|
|
||||||
SetBluePlanesGroup:ForEachGroup(
|
SetBluePlanesGroup:ForEachGroup(
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetNorthKoreaGroup:ForEachGroup(
|
SetNorthKoreaGroup:ForEachGroup(
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeRed()
|
UnitAction:SmokeRed()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetSAMGroup:ForEachGroup(
|
SetSAMGroup:ForEachGroup(
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeOrange()
|
UnitAction:SmokeOrange()
|
||||||
end
|
end
|
||||||
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 )
|
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( POINT_VEC3.SmokeColor.White )
|
||||||
|
|
||||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||||
--- @param Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user