#DYNAMICCARGO - Added functionalty

This commit is contained in:
Applevangelist
2024-08-16 09:36:29 +02:00
parent 24264bd885
commit 19f6a8d8f6
10 changed files with 865 additions and 89 deletions

View File

@@ -226,6 +226,26 @@ function STORAGE:NewFromStaticCargo(StaticCargoName)
return self
end
--- Create a new STORAGE object from an DCS static cargo object.
-- @param #STORAGE self
-- @param #string DynamicCargoName Unit name of the dynamic cargo.
-- @return #STORAGE self
function STORAGE:NewFromDynamicCargo(DynamicCargoName)
-- Inherit everything from BASE class.
local self=BASE:Inherit(self, BASE:New()) -- #STORAGE
self.airbase=Unit.getByName(DynamicCargoName)
if Airbase.getWarehouse then
self.warehouse=Warehouse.getCargoAsWarehouse(self.airbase)
end
self.lid = string.format("STORAGE %s", DynamicCargoName)
return self
end
--- Airbases only - Find a STORAGE in the **_DATABASE** using the name associated airbase.
-- @param #STORAGE self