mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Implement SET_GROUP:NoneInZone()
This commit is contained in:
parent
bfda34e94d
commit
a058556583
@ -1006,7 +1006,7 @@ end
|
|||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||||
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
|
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
|
||||||
function SET_GROUP:AnyCompletelyInZone(Zone)
|
function SET_GROUP:AnyPartlyInZone(Zone)
|
||||||
self:F2(Zone)
|
self:F2(Zone)
|
||||||
local Set = self:GetSet()
|
local Set = self:GetSet()
|
||||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||||
@ -1017,6 +1017,21 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
|
||||||
|
-- @param #SET_GROUP self
|
||||||
|
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||||
|
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
|
||||||
|
function SET_GROUP:NoneInZone(Zone)
|
||||||
|
self:F2(Zone)
|
||||||
|
local Set = self:GetSet()
|
||||||
|
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||||
|
if not GroupData:IsNotInZone(Zone) then -- If the GROUP is in Zone in any way
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
|
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
|
||||||
---- @param #SET_GROUP self
|
---- @param #SET_GROUP self
|
||||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
|
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user