From e301efc690d04071f4c0c85ab72e33c8fa3990b3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 3 Aug 2024 13:47:38 +0200 Subject: [PATCH] xx --- Moose Development/Moose/Core/Set.lua | 25 +++++++++++++++++++++++-- Moose Development/Moose/Core/Spawn.lua | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 5c886ed7d..002d08392 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -2149,7 +2149,7 @@ end do -- SET_UNIT --- - -- @type SET_UNIT + -- @type SET_UNIT SET\_UNIT -- @field Core.Timer#TIMER ZoneTimer -- @field #number ZoneTimerInterval -- @extends Core.Set#SET_BASE @@ -2300,7 +2300,12 @@ do -- SET_UNIT local self = BASE:Inherit( self, SET_BASE:New( _DATABASE.UNITS ) ) -- #SET_UNIT self:FilterActive( false ) - + + --- Count Alive Units + -- @function [parent=#SET_UNIT] CountAlive + -- @param #SET_UNIT self + -- @return #SET_UNIT self + return self end @@ -2502,6 +2507,22 @@ do -- SET_UNIT self.Filter.Active = Active return self end + + --- Builds a set of units which exist and are alive. + -- @param #SET_UNIT self + -- @return #SET_UNIT self + function SET_UNIT:FilterAlive() + self:FilterFunction( + function(unit) + if unit and unit:IsExist() and unit:IsAlive() then + return true + else + return false + end + end + ) + return self + end --- Builds a set of units having a radar of give types. -- All the units having a radar of a given type will be included within the set. diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index a7cc04718..5e8621921 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -1053,7 +1053,7 @@ end -- but they will all follow the same Template route and have the same prefix name. -- In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group. -- @param #SPAWN self --- @param #string SpawnTemplatePrefixTable A table with the names of the groups defined within the mission editor, from which one will be chosen when a new group will be spawned. +-- @param #list<#string> SpawnTemplatePrefixTable A table with the names of the groups defined within the mission editor, from which one will be chosen when a new group will be spawned. -- @return #SPAWN -- @usage --