This commit is contained in:
FlightControl
2017-05-18 16:26:31 +02:00
parent 48595e1282
commit 3106f62709
4 changed files with 97 additions and 36 deletions

View File

@@ -1302,6 +1302,32 @@ do -- DETECTION_BASE
return nil
end
do -- Coordinates
--- Get the COORDINATE of a detection item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
-- @return Core.Point#COORDINATE Coordinate
function DETECTION_BASE:GetDetectedItemCoordinate( Index )
-- If the Zone is set, return the coordinate of the Zone.
local DetectedZone = self:GetDetectedItemZone( Index )
if DetectedZone then
return DetectedZone:GetCoordinate()
end
-- If no Zone is set, return the coordinate of the first unit in the Set
local DetectedItemSet = self:GetDetectedSet( Index )
local FirstUnit = DetectedItemSet:GetFirst()
if FirstUnit then
return FirstUnit:GetCoordinate()
end
return nil
end
end
do -- Zones
@@ -1309,13 +1335,15 @@ do -- DETECTION_BASE
-- @param #DETECTION_BASE self
-- @param #number Index
-- @return Core.Zone#ZONE_UNIT DetectedZone
function DETECTION_BASE:GetDetectedZone( Index )
function DETECTION_BASE:GetDetectedItemZone( Index )
local DetectedZone = self.DetectedItems[Index].Zone
if DetectedZone then
return DetectedZone
end
local Detected
return nil
end
@@ -1977,7 +2005,7 @@ do -- DETECTION_AREAS
local DetectedSet = self:GetDetectedSet( Index )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedZone = self:GetDetectedItemZone( Index )
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
local DetectedItemCoordText = DetectedItemCoordinate:ToString()
@@ -2007,7 +2035,7 @@ do -- DETECTION_AREAS
local DetectedSet = self:GetDetectedSet( Index )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedZone = self:GetDetectedItemZone( Index )
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
local DetectedItemCoordText = DetectedItemCoordinate:ToString()