mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
-- Further fixes for TASK_CARGO_TRANSPORT
This commit is contained in:
parent
75d179176d
commit
93640b1d8e
@ -202,26 +202,6 @@ end
|
|||||||
|
|
||||||
-- Get methods
|
-- Get methods
|
||||||
|
|
||||||
--- Returns the UNITs wrappers of the DCS Units of the Controllable (default is a GROUP).
|
|
||||||
-- @param #CONTROLLABLE self
|
|
||||||
-- @return #list<Wrapper.Unit#UNIT> The UNITs wrappers.
|
|
||||||
function CONTROLLABLE:GetUnits()
|
|
||||||
self:F2( { self.ControllableName } )
|
|
||||||
local DCSControllable = self:GetDCSObject()
|
|
||||||
|
|
||||||
if DCSControllable then
|
|
||||||
local DCSUnits = DCSControllable:getUnits()
|
|
||||||
local Units = {}
|
|
||||||
for Index, UnitData in pairs( DCSUnits ) do
|
|
||||||
Units[#Units+1] = UNIT:Find( UnitData )
|
|
||||||
end
|
|
||||||
self:T3( Units )
|
|
||||||
return Units
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--- Returns the health. Dead controllables have health <= 1.0.
|
--- Returns the health. Dead controllables have health <= 1.0.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
|
|||||||
@ -330,6 +330,25 @@ function GROUP:GetCountry()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Returns a list of @{Unit} objects of the @{Group}.
|
||||||
|
-- @param #GROUP self
|
||||||
|
-- @return #list<Wrapper.Unit#UNIT> The list of @{Unit} objects of the @{Group}.
|
||||||
|
function GROUP:GetUnits()
|
||||||
|
self:F2( { self.GroupName } )
|
||||||
|
local DCSGroup = self:GetDCSObject()
|
||||||
|
|
||||||
|
if DCSGroup then
|
||||||
|
local DCSUnits = DCSGroup:getUnits()
|
||||||
|
local Units = {}
|
||||||
|
for Index, UnitData in pairs( DCSUnits ) do
|
||||||
|
Units[#Units+1] = UNIT:Find( UnitData )
|
||||||
|
end
|
||||||
|
self:T3( Units )
|
||||||
|
return Units
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
--- Returns the UNIT wrapper class with number UnitNumber.
|
--- Returns the UNIT wrapper class with number UnitNumber.
|
||||||
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
-- If the underlying DCS Unit does not exist, the method will return nil. .
|
||||||
-- @param #GROUP self
|
-- @param #GROUP self
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user