mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
a06d099917
@ -531,6 +531,21 @@ do -- SET_BASE
|
|||||||
|
|
||||||
return self.SomeIteratorLimit or self:Count()
|
return self.SomeIteratorLimit or self:Count()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get max threat level of all objects in the SET.
|
||||||
|
-- @param #SET_BASE self
|
||||||
|
-- @return #number Max threat level found.
|
||||||
|
function SET_BASE:GetThreatLevelMax()
|
||||||
|
local ThreatMax = 0
|
||||||
|
for _,_unit in pairs(self.Set or {}) do
|
||||||
|
local unit = _unit -- Wrapper.Unit#UNIT
|
||||||
|
local threat = unit.GetThreatLevel and unit:GetThreatLevel() or 0
|
||||||
|
if threat > ThreatMax then
|
||||||
|
ThreatMax = threat
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ThreatMax
|
||||||
|
end
|
||||||
|
|
||||||
--- Filters for the defined collection.
|
--- Filters for the defined collection.
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user