mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Work in progress. Limit functions for POSITIONABLE.
This commit is contained in:
parent
b438df27a4
commit
a14c2ef589
@ -188,7 +188,6 @@ function AI_CARGO_AIRPLANE:SetCarrier( Airplane )
|
||||
|
||||
|
||||
function Airplane:OnEventEngineShutdown( EventData )
|
||||
self:F("Calling")
|
||||
AICargo:Landed( self.Airplane )
|
||||
end
|
||||
|
||||
@ -233,8 +232,6 @@ end
|
||||
function AI_CARGO_AIRPLANE:onafterLanded( Airplane, From, Event, To )
|
||||
|
||||
self:F({Airplane, From, Event, To})
|
||||
self:F({IsAlive=Airplane:IsAlive()})
|
||||
self:F({RoutePickup=self.RoutePickup})
|
||||
|
||||
if Airplane and Airplane:IsAlive()~=nil then
|
||||
|
||||
@ -406,6 +403,7 @@ function AI_CARGO_AIRPLANE:onafterLoaded( Airplane, From, Event, To )
|
||||
env.info("FF troops loaded into cargo plane")
|
||||
|
||||
if Airplane and Airplane:IsAlive() then
|
||||
-- Check if another cargo can be loaded into the airplane.
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -403,6 +403,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
||||
|
||||
-- The Pickup sequence ...
|
||||
-- Check if this Carrier need to go and Pickup something...
|
||||
-- So, if the cargo bay is not full yet with cargo to be loaded ...
|
||||
self:I( { IsTransporting = AI_Cargo:IsTransporting() } )
|
||||
if AI_Cargo:IsTransporting() == false then
|
||||
-- ok, so there is a free Carrier
|
||||
|
||||
@ -798,6 +798,8 @@ function POSITIONABLE:GetLaserCode() --R2.1
|
||||
return self.LaserCode
|
||||
end
|
||||
|
||||
do -- Cargo
|
||||
|
||||
--- Add cargo.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param Core.Cargo#CARGO Cargo
|
||||
@ -849,6 +851,47 @@ function POSITIONABLE:CargoItemCount()
|
||||
return ItemCount
|
||||
end
|
||||
|
||||
--- Get Cargo Bay Free Volume in m3.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return #number CargoBayFreeVolume
|
||||
function POSITIONABLE:GetCargoBayFreeVolume()
|
||||
local CargoVolume = 0
|
||||
for CargoName, Cargo in pairs( self.__.Cargo ) do
|
||||
CargoVolume = CargoVolume + Cargo:GetVolume()
|
||||
end
|
||||
return self.__.CargoBayVolumeLimit - CargoVolume
|
||||
end
|
||||
|
||||
--- Get Cargo Bay Free Weight in kg.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return #number CargoBayFreeWeight
|
||||
function POSITIONABLE:GetCargoBayFreeWeight()
|
||||
local CargoWeight = 0
|
||||
for CargoName, Cargo in pairs( self.__.Cargo ) do
|
||||
CargoWeight = CargoWeight + Cargo:GetWeight()
|
||||
end
|
||||
return self.__.CargoBayWeightLimit - CargoWeight
|
||||
end
|
||||
|
||||
--- Get Cargo Bay Volume Limit in m3.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param #number VolumeLimit
|
||||
function POSITIONABLE:SetCargoBayVolumeLimit( VolumeLimit )
|
||||
self.__.CargoBayVolumeLimit = VolumeLimit
|
||||
end
|
||||
|
||||
--- Get Cargo Bay Weight Limit in kg.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param #number WeightLimit
|
||||
function POSITIONABLE:GetCargoBayFreeWeightLimit( WeightLimit )
|
||||
self.__.CargoBayWeightLimit = WeightLimit
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end --- Cargo
|
||||
|
||||
--- Signal a flare at the position of the POSITIONABLE.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param Utilities.Utils#FLARECOLOR FlareColor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user