mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Added FilterActive() method in SET\_UNIT, SET\GROUP, SET\_CLIENT.
Haven't tested the behaviour for CLIENTs joining and leaving.
This commit is contained in:
@@ -205,18 +205,18 @@ function GROUP:GetPositionVec3() -- Overridden from POSITIONABLE:GetPositionVec3
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns if the Group is alive.
|
||||
--- Returns if the group is alive.
|
||||
-- The Group must:
|
||||
--
|
||||
-- * Exist at run-time.
|
||||
-- * Has at least one unit.
|
||||
--
|
||||
-- When the first @{Wrapper.Unit} of the Group is active, it will return true.
|
||||
-- If the first @{Wrapper.Unit} of the Group is inactive, it will return false.
|
||||
-- When the first @{Wrapper.Unit} of the group is active, it will return true.
|
||||
-- If the first @{Wrapper.Unit} of the group is inactive, it will return false.
|
||||
--
|
||||
-- @param #GROUP self
|
||||
-- @return #boolean true if the Group is alive and active.
|
||||
-- @return #boolean false if the Group is alive but inactive.
|
||||
-- @return #boolean true if the group is alive and active.
|
||||
-- @return #boolean false if the group is alive but inactive.
|
||||
-- @return #nil if the group does not exist anymore.
|
||||
function GROUP:IsAlive()
|
||||
self:F2( self.GroupName )
|
||||
@@ -237,6 +237,26 @@ function GROUP:IsAlive()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns if the group is activated.
|
||||
-- @param #GROUP self
|
||||
-- @return #boolean true if group is activated.
|
||||
-- @return #nil The group is not existing or alive.
|
||||
function GROUP:IsActive()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
local DCSGroup = self:GetDCSObject() -- DCS#Group
|
||||
|
||||
if DCSGroup then
|
||||
|
||||
local GroupIsActive = DCSGroup:getUnit(1):isActive()
|
||||
return GroupIsActive
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Destroys the DCS Group and all of its DCS Units.
|
||||
-- Note that this destroy method also can raise a destroy event at run-time.
|
||||
-- So all event listeners will catch the destroy event of this group for each unit in the group.
|
||||
|
||||
Reference in New Issue
Block a user