Added JTAC to DETECTION_DISPATCHER

Added Process_JTAC to coordinate this activity during a CAS or BAI.
Removed TASK_CAS and TASK BAI into a generic TASK_A2G task.
This commit is contained in:
FlightControl
2016-07-21 15:28:53 +02:00
parent 8e8fcef266
commit 2eeaf7b92d
56 changed files with 1440 additions and 1280 deletions

View File

@@ -1365,10 +1365,10 @@ function SET_UNIT:ForEachUnitNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
--- Returns a comma separated string of the unit types with a count in the @{Set}.
--- Returns map of unit types.
-- @param #SET_UNIT self
-- @return #string The unit types string
function SET_UNIT:GetUnitTypesText()
-- @return #map<#string,#number> A map of the unit types found. The key is the UnitTypeName and the value is the amount of unit types found.
function SET_UNIT:GetUnitTypes()
self:F2()
local MT = {} -- Message Text
@@ -1391,9 +1391,49 @@ function SET_UNIT:GetUnitTypesText()
MT[#MT+1] = UnitType .. " of " .. UnitTypeID
end
return UnitTypes
end
--- Returns a comma separated string of the unit types with a count in the @{Set}.
-- @param #SET_UNIT self
-- @return #string The unit types string
function SET_UNIT:GetUnitTypesText()
self:F2()
local MT = {} -- Message Text
local UnitTypes = self:GetUnitTypes()
for UnitTypeID, UnitType in pairs( UnitTypes ) do
MT[#MT+1] = UnitType .. " of " .. UnitTypeID
end
return table.concat( MT, ", " )
end
--- Returns map of unit threat levels.
-- @param #SET_UNIT self
-- @return #table.
function SET_UNIT:GetUnitThreatLevels()
self:F2()
local UnitThreatLevels = {}
for UnitID, UnitData in pairs( self:GetSet() ) do
local ThreatUnit = UnitData -- Unit#UNIT
if ThreatUnit:IsAlive() then
local UnitThreatLevel, UnitThreatLevelText = ThreatUnit:GetThreatLevel()
local ThreatUnitName = ThreatUnit:GetName()
UnitThreatLevels[UnitThreatLevel] = UnitThreatLevels[UnitThreatLevel] or {}
UnitThreatLevels[UnitThreatLevel].UnitThreatLevelText = UnitThreatLevelText
UnitThreatLevels[UnitThreatLevel].Units = UnitThreatLevels[UnitThreatLevel].Units or {}
UnitThreatLevels[UnitThreatLevel].Units[ThreatUnitName] = ThreatUnit
end
end
return UnitThreatLevels
end
--- Returns if the @{Set} has targets having a radar (of a given type).
-- @param #SET_UNIT self