Cargo Crate transportation working :-)

This commit is contained in:
FlightControl_Master
2018-04-05 15:06:36 +02:00
parent 0d995d1832
commit c60dda2545
8 changed files with 299 additions and 68 deletions

View File

@@ -48,6 +48,24 @@ STATIC = {
}
function STATIC:Register( StaticName )
local self = BASE:Inherit( self, POSITIONABLE:New( StaticName ) )
self.StaticName = StaticName
return self
end
--- Finds a STATIC from the _DATABASE using a DCSStatic object.
-- @param #STATIC self
-- @param Dcs.DCSWrapper.Static#Static DCSStatic An existing DCS Static object reference.
-- @return #STATIC self
function STATIC:Find( DCSStatic )
local StaticName = DCSStatic:getName()
local StaticFound = _DATABASE:FindStatic( StaticName )
return StaticFound
end
--- Finds a STATIC from the _DATABASE using the relevant Static Name.
-- As an optional parameter, a briefing text can be given also.
-- @param #STATIC self
@@ -71,12 +89,6 @@ function STATIC:FindByName( StaticName, RaiseError )
return nil
end
function STATIC:Register( StaticName )
local self = BASE:Inherit( self, POSITIONABLE:New( StaticName ) )
self.StaticName = StaticName
return self
end
function STATIC:GetDCSObject()
local DCSStatic = StaticObject.getByName( self.StaticName )
@@ -88,6 +100,27 @@ function STATIC:GetDCSObject()
return nil
end
--- Returns a list of one @{Static}.
-- @param #STATIC self
-- @return #list<Wrapper.Static#STATIC> A list of one @{Static}.
function STATIC:GetUnits()
self:F2( { self.StaticName } )
local DCSStatic = self:GetDCSObject()
local Statics = {}
if DCSStatic then
Statics[1] = STATIC:Find( DCSStatic )
self:T3( Statics )
return Statics
end
return nil
end
function STATIC:GetThreatLevel()
return 1, "Static"