-- Added AnyInZone stuff.

-- Now for tasking, routing messages show the task name...
This commit is contained in:
FlightControl
2018-10-01 22:06:42 +02:00
parent 8f6a3d5c49
commit ec9a5efdde
3 changed files with 44 additions and 4 deletions

View File

@@ -1008,6 +1008,23 @@ function GROUP:IsNotInZone( Zone )
return true
end
--- Returns true if any units of the group are within a @{Core.Zone}.
-- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if any unit of the Group is within the @{Core.Zone#ZONE_BASE}
function GROUP:IsAnyInZone( Zone )
if not self:IsAlive() then return false end
for UnitID, UnitData in pairs( self:GetUnits() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
if Zone:IsVec3InZone( Unit:GetVec3() ) then
return true
end
end
return false
end
--- Returns the number of UNITs that are in the @{Zone}
-- @param #GROUP self
-- @param Core.Zone#ZONE_BASE Zone The zone to test.