Updated the Escort class

- Registering each excort at the client internally.
- Each escort known at the client can exchange targets.
- Each escort can acquire attack assistance from other escorts known at
the client.
- Made the MENU class more slick. Now menus are removed recursively for
CLIENTS.
- Added a few more types and fine tuned the documentation.
This commit is contained in:
FlightControl
2016-04-07 17:34:44 +02:00
parent 2812339cc1
commit ab332f22e7
8 changed files with 489 additions and 146 deletions

View File

@@ -49,6 +49,11 @@ UNIT = {
-- @field Orange
-- @field Blue
--- Create a new UNIT from DCSUnit.
-- @param #UNIT self
-- @param DCSUnit#Unit DCSUnit
-- @return Unit#UNIT
function UNIT:New( DCSUnit )
local self = BASE:Inherit( self, BASE:New() )
self:F( DCSUnit:getName() )
@@ -231,4 +236,21 @@ function UNIT:SmokeBlue()
trigger.action.smoke( self:GetPositionVec3(), trigger.smokeColor.Blue )
end
-- Is methods
--- Returns if the unit is of an air category.
-- If the unit is a helicopter or a plane, then this method will return true, otherwise false.
-- @param #UNIT self
-- @return #boolean Air category evaluation result.
function UNIT:IsAir()
self:F()
local UnitDescriptor = self.DCSUnit:getDesc()
self:T( { UnitDescriptor.category, Unit.Category.AIRPLANE, Unit.Category.HELICOPTER } )
local IsAirResult = ( UnitDescriptor.category == Unit.Category.AIRPLANE ) or ( UnitDescriptor.category == Unit.Category.HELICOPTER )
self:T( IsAirResult )
return IsAirResult
end