Refactoring

This commit is contained in:
Frank
2020-05-16 12:58:59 +02:00
parent 5afd5cae27
commit 9b72254ccc
5 changed files with 496 additions and 323 deletions
@@ -1444,21 +1444,12 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType )
params = {
point = Vec2,
zoneRadius = Radius,
expendQty = 100, -- dummy value
expendQtyEnabled = false,
expendQty = AmmoCount or 100,
expendQtyEnabled = AmmoCount and true or false,
weaponType = WeaponType or ENUMS.WeaponFlag.Auto,
}
}
if AmmoCount then
DCSTask.params.expendQty = AmmoCount
DCSTask.params.expendQtyEnabled = true
end
if WeaponType then
DCSTask.params.weaponType=WeaponType
end
self:T3( { DCSTask } )
return DCSTask
end
@@ -602,6 +602,26 @@ function POSITIONABLE:IsGround()
end
--- Returns if the unit is of ship category.
-- @param #POSITIONABLE self
-- @return #boolean Ship category evaluation result.
function POSITIONABLE:IsShip()
self:F2()
local DCSUnit = self:GetDCSObject()
if DCSUnit then
local UnitDescriptor = DCSUnit:getDesc()
local IsShip = ( UnitDescriptor.category == Unit.Category.SHIP )
return IsShip
end
return nil
end
--- Returns true if the POSITIONABLE is in the air.
-- Polymorphic, is overridden in GROUP and UNIT.
-- @param Wrapper.Positionable#POSITIONABLE self