This commit is contained in:
Applevangelist
2025-02-21 10:39:38 +01:00
parent 093c3fe7c9
commit 367d1c6715
4 changed files with 46 additions and 9 deletions

View File

@@ -531,6 +531,21 @@ do -- SET_BASE
return self.SomeIteratorLimit or self:Count()
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.
-- @param #SET_BASE self