Merge branch 'FF/Develop' of https://github.com/FlightControl-Master/MOOSE into FF/Develop

This commit is contained in:
funkyfranky
2019-03-27 16:24:17 +01:00
24 changed files with 919 additions and 280 deletions

View File

@@ -142,6 +142,7 @@ do -- Goal
-- @param #GOAL self
-- @param #string PlayerName The name of the player.
function GOAL:AddPlayerContribution( PlayerName )
self:F({PlayerName})
self.Players[PlayerName] = self.Players[PlayerName] or 0
self.Players[PlayerName] = self.Players[PlayerName] + 1
self.TotalContributions = self.TotalContributions + 1

View File

@@ -130,6 +130,20 @@ do -- SET_BASE
return self
end
--- Clear the Objects in the Set.
-- @param #SET_BASE self
-- @return #SET_BASE self
function SET_BASE:Clear()
for Name, Object in pairs( self.Set ) do
self:Remove( Name )
end
return self
end
--- Finds an @{Core.Base#BASE} object based on the object Name.
-- @param #SET_BASE self
@@ -148,7 +162,7 @@ do -- SET_BASE
function SET_BASE:GetSet()
self:F2()
return self.Set
return self.Set or {}
end
--- Gets a list of the Names of the Objects in the Set.

View File

@@ -631,8 +631,8 @@ end
-- * @{ZONE_RADIUS.IsNoneInZone}(): Scan if the zone is empty.
-- @{#ZONE_RADIUS.
-- @param #ZONE_RADIUS self
-- @param ObjectCategories
-- @param UnitCategories
-- @param ObjectCategories An array of categories of the objects to find in the zone.
-- @param UnitCategories An array of unit categories of the objects to find in the zone.
-- @usage
-- self.Zone:Scan()
-- local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
@@ -704,6 +704,31 @@ function ZONE_RADIUS:GetScannedUnits()
end
function ZONE_RADIUS:GetScannedSetUnit()
local SetUnit = SET_UNIT:New()
if self.ScanData then
for ObjectID, UnitObject in pairs( self.ScanData.Units ) do
local UnitObject = UnitObject -- DCS#Unit
if UnitObject:isExist() then
local FoundUnit = UNIT:FindByName( UnitObject:getName() )
if FoundUnit then
SetUnit:AddUnit( FoundUnit )
else
local FoundStatic = STATIC:FindByName( UnitObject:getName() )
if FoundStatic then
SetUnit:AddUnit( FoundStatic )
end
end
end
end
end
return SetUnit
end
function ZONE_RADIUS:CountScannedCoalitions()
local Count = 0