diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index fed13c2a4..d4e6e7e95 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -64,6 +64,7 @@ DATABASE = { COUNTRY_NAME = {}, NavPoints = {}, PLAYERSETTINGS = {}, + ZONENAMES = {}, } local _DATABASECoalition = @@ -1024,6 +1025,11 @@ function DATABASE:_RegisterTemplates() end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then end --for coa_name, coa_data in pairs(mission.coalition) do + for ZoneID, ZoneData in pairs( env.triggers.zones ) do + local ZoneName = ZoneData.Name + self.ZONENAMES[ZoneName] = ZoneName + end + return self end diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua index 1c03860e8..6be2a0834 100644 --- a/Moose Development/Moose/Tasking/CommandCenter.lua +++ b/Moose Development/Moose/Tasking/CommandCenter.lua @@ -91,6 +91,9 @@ COMMANDCENTER = { CommandCenterCoalition = nil, CommandCenterPositionable = nil, Name = "", + ReferencePoints = {}, + ReferenceNames = {}, + CommunicationMode = "80", } --- The constructor takes an IDENTIFIABLE as the HQ command center. -- @param #COMMANDCENTER self @@ -251,6 +254,34 @@ function COMMANDCENTER:RemoveMission( Mission ) return Mission end +--- Set reference points known by the command center to guide airborne units during WWII. +-- These reference points are zones, with a special name. +-- @param #COMMANDCENTER self +-- @param #string ReferenceZonePrefix Reference points. +-- @return #COMMANDCENTER +function COMMANDCENTER:SetReferenceZones( ReferenceZonePrefix ) + local MatchPattern = "(" .. ReferenceZonePrefix .. ")" .. "#(a+)" + for ReferenceZoneName in pairs( _DATABASE.ZONENAMES ) do + local ZoneName, ReferenceName = string.match( ReferenceZoneName, MatchPattern ) + self:T( { ZoneName = ZoneName, ReferenceName = ReferenceName } ) + if ZoneName and ReferenceName then + self.ReferencePoints[ZoneName] = ZONE:New( ZoneName ) + self.ReferenceNames[ZoneName] = ReferenceName + end + end + return self +end + +--- Set the commandcenter operations in WWII mode +-- This will disable LL, MGRS, BRA, BULLS from the settings. +-- It will also disable the settings at the settings menu for these. +-- And, it will use any ReferenceZones set as reference points for communication. +-- @param #COMMANDCENTER self +-- @return #COMMANDCENTER +function COMMANDCENTER:SetModeWWII() + self.CommunicationMode = "WWII" +end + --- Sets the menu structure of the Missions governed by the HQ command center. -- @param #COMMANDCENTER self function COMMANDCENTER:SetMenu() diff --git a/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua b/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua index ca0f56050..3e95e6f29 100644 --- a/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua +++ b/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua @@ -1,35 +1,6 @@ --- **Tasking** - The TASK_A2A_DISPATCHER creates and manages player TASK_A2A tasks based on detected targets. -- -- === --- --- # 1) @{#TASK_A2A_DISPATCHER} class, extends @{#DETECTION_MANAGER} --- --- The @{#TASK_A2A_DISPATCHER} class implements the dynamic dispatching of tasks upon groups of detected units determined a @{Set} of EWR installation groups. --- The EWR will detect units, will group them, and will dispatch @{Task}s to groups. Depending on the type of target detected, different tasks will be dispatched. --- Find a summary below describing for which situation a task type is created: --- --- * **INTERCEPT Task**: Is created when the target is known, is detected and within a danger zone, and there is no friendly airborne in range. --- * **SWEEP Task**: Is created when the target is unknown, was detected and the last position is only known, and within a danger zone, and there is no friendly airborne in range. --- * **ENGAGE Task**: Is created when the target is known, is detected and within a danger zone, and there is a friendly airborne in range, that will receive this task. --- --- Other task types will follow... --- --- 3.1) TASK_A2A_DISPATCHER constructor: --- -------------------------------------- --- The @{#TASK_A2A_DISPATCHER.New}() method creates a new TASK_A2A_DISPATCHER instance. --- --- === --- --- # **API CHANGE HISTORY** --- --- The underlying change log documents the API changes. Please read this carefully. The following notation is used: --- --- * **Added** parts are expressed in bold type face. --- * _Removed_ parts are expressed in italic type face. --- --- Hereby the change log: --- --- === -- -- # **AUTHORS and CONTRIBUTIONS** -- @@ -45,10 +16,25 @@ do -- TASK_A2A_DISPATCHER --- TASK_A2A_DISPATCHER class. -- @type TASK_A2A_DISPATCHER - -- @field Set#SET_GROUP SetGroup The groups to which the FAC will report to. - -- @field Functional.Detection#DETECTION_BASE Detection The DETECTION_BASE object that is used to report the detected objects. The Detection object will only function in RADAR mode!!! - -- @field Tasking.Mission#MISSION Mission -- @extends Tasking.DetectionManager#DETECTION_MANAGER + + --- # TASK_A2A_DISPATCHER class, extends @{Tasking#DETECTION_MANAGER} + -- + -- The @{#TASK_A2A_DISPATCHER} class implements the dynamic dispatching of tasks upon groups of detected units determined a @{Set} of EWR installation groups. + -- The EWR will detect units, will group them, and will dispatch @{Task}s to groups. Depending on the type of target detected, different tasks will be dispatched. + -- Find a summary below describing for which situation a task type is created: + -- + -- * **INTERCEPT Task**: Is created when the target is known, is detected and within a danger zone, and there is no friendly airborne in range. + -- * **SWEEP Task**: Is created when the target is unknown, was detected and the last position is only known, and within a danger zone, and there is no friendly airborne in range. + -- * **ENGAGE Task**: Is created when the target is known, is detected and within a danger zone, and there is a friendly airborne in range, that will receive this task. + -- + -- Other task types will follow... + -- + -- # TASK_A2A_DISPATCHER constructor: + -- -------------------------------------- + -- The @{#TASK_A2A_DISPATCHER.New}() method creates a new TASK_A2A_DISPATCHER instance. + -- + -- @field #TASK_A2A_DISPATCHER TASK_A2A_DISPATCHER = { ClassName = "TASK_A2A_DISPATCHER", Mission = nil, @@ -71,6 +57,8 @@ do -- TASK_A2A_DISPATCHER self.Detection = Detection self.Mission = Mission + + -- TODO: Check detection through radar. self.Detection:FilterCategories( Unit.Category.AIRPLANE, Unit.Category.HELICOPTER ) --self.Detection:InitDetectRadar( true ) self.Detection:SetDetectionInterval( 30 )