mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Astar
This commit is contained in:
@@ -2100,6 +2100,7 @@ end
|
||||
|
||||
--- Calculate the maxium A2G threat level of the Group.
|
||||
-- @param #GROUP self
|
||||
-- @return #number Number between 0 and 10.
|
||||
function GROUP:CalculateThreatLevelA2G()
|
||||
|
||||
local MaxThreatLevelA2G = 0
|
||||
@@ -2115,6 +2116,25 @@ function GROUP:CalculateThreatLevelA2G()
|
||||
return MaxThreatLevelA2G
|
||||
end
|
||||
|
||||
--- Get threat level of the group.
|
||||
-- @param #GROUP self
|
||||
-- @return #number Max threat level (a number between 0 and 10).
|
||||
function GROUP:GetThreatLevel()
|
||||
|
||||
local threatlevelMax = 0
|
||||
for UnitName, UnitData in pairs(self:GetUnits()) do
|
||||
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
|
||||
local threatlevel = ThreatUnit:GetThreatLevel()
|
||||
if threatlevel > threatlevelMax then
|
||||
threatlevelMax=threatlevel
|
||||
end
|
||||
end
|
||||
|
||||
return threatlevelMax
|
||||
end
|
||||
|
||||
|
||||
--- Returns true if the first unit of the GROUP is in the air.
|
||||
-- @param Wrapper.Group#GROUP self
|
||||
-- @return #boolean true if in the first unit of the group is in the air or #nil if the GROUP is not existing or not alive.
|
||||
|
||||
Reference in New Issue
Block a user