mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Finish Cargo/AI_Cargo_Helicopter
This commit is contained in:
parent
d07d063265
commit
d05973f487
@ -308,7 +308,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
self:Pickup( Carrier, Cargo )
|
self:Pickup( Carrier, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AI_Cargo.OnAfterLoad( AI_Cargo, Carrier )
|
function AI_Cargo.OnAfterLoad( AI_Cargo, Carrier, From, Event, To, Cargo )
|
||||||
self:Loading( Carrier )
|
self:Loading( Carrier )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -316,16 +316,16 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
self:Loaded( Carrier, Cargo )
|
self:Loaded( Carrier, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AI_Cargo.OnAfterDeploy( AI_Cargo, Carrier )
|
function AI_Cargo.OnAfterDeploy( AI_Cargo, Carrier, From, Event, To, Cargo )
|
||||||
self:Deploy( Carrier )
|
self:Deploy( Carrier, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AI_Cargo.OnAfterUnload( AI_Cargo, Carrier )
|
function AI_Cargo.OnAfterUnload( AI_Cargo, Carrier, From, Event, To, Cargo )
|
||||||
self:Unloading( Carrier )
|
self:Unloading( Carrier, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AI_Cargo.OnAfterUnloaded( AI_Cargo, Carrier )
|
function AI_Cargo.OnAfterUnloaded( AI_Cargo, Carrier, From, Event, To, Cargo )
|
||||||
self:Unloaded( Carrier )
|
self:Unloaded( Carrier, Cargo )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ end
|
|||||||
-- @param #number Delay
|
-- @param #number Delay
|
||||||
|
|
||||||
function AI_CARGO_DISPATCHER:onafterStart( From, Event, To )
|
function AI_CARGO_DISPATCHER:onafterStart( From, Event, To )
|
||||||
self:Monitor()
|
self:__Monitor( -1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Stop Handler OnBefore for AI_CARGO_DISPATCHER
|
--- Stop Handler OnBefore for AI_CARGO_DISPATCHER
|
||||||
@ -434,16 +434,27 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Make a Carrier run for a cargo deploy action after the cargo Pickup trigger has been initiated, by default.
|
--- Loaded Handler OnAfter for AI_CARGO_DISPATCHER
|
||||||
|
-- @function [parent=#AI_CARGO_DISPATCHER] OnAfterLoaded
|
||||||
-- @param #AI_CARGO_DISPATCHER self
|
-- @param #AI_CARGO_DISPATCHER self
|
||||||
-- @param From
|
-- @param #string From
|
||||||
-- @param Event
|
-- @param #string Event
|
||||||
-- @param To
|
-- @param #string To
|
||||||
-- @param Wrapper.Group#GROUP Carrier
|
-- @param Wrapper.Group#GROUP Carrier
|
||||||
-- @param Cargo.Cargo#CARGO Cargo
|
-- @param Cargo.Cargo#CARGO Cargo
|
||||||
-- @return #AI_CARGO_DISPATCHER
|
|
||||||
function AI_CARGO_DISPATCHER:OnAfterPickup( From, Event, To, Carrier, Cargo )
|
--- Unloaded Handler OnAfter for AI_CARGO_DISPATCHER
|
||||||
end
|
-- @function [parent=#AI_CARGO_DISPATCHER] OnAfterUnloaded
|
||||||
|
-- @param #AI_CARGO_DISPATCHER self
|
||||||
|
-- @param #string From
|
||||||
|
-- @param #string Event
|
||||||
|
-- @param #string To
|
||||||
|
-- @param Wrapper.Group#GROUP Carrier
|
||||||
|
-- @param Cargo.Cargo#CARGO Cargo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Make a Carrier run for a cargo deploy action after the cargo has been loaded, by default.
|
--- Make a Carrier run for a cargo deploy action after the cargo has been loaded, by default.
|
||||||
|
|||||||
@ -352,6 +352,17 @@ do -- CARGO
|
|||||||
return self.Name
|
return self.Name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get the current active object representing or being the Cargo.
|
||||||
|
-- @param #CARGO self
|
||||||
|
-- @return Wrapper.Positionable#POSITIONABLE The object representing or being the Cargo.
|
||||||
|
function CARGO:GetObject()
|
||||||
|
if self:IsLoaded() then
|
||||||
|
return self.CargoCarrier
|
||||||
|
else
|
||||||
|
return self.CargoObject
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Get the object name of the Cargo.
|
--- Get the object name of the Cargo.
|
||||||
-- @param #CARGO self
|
-- @param #CARGO self
|
||||||
-- @return #string The object name of the Cargo.
|
-- @return #string The object name of the Cargo.
|
||||||
|
|||||||
@ -107,7 +107,7 @@ do -- CARGO_GROUP
|
|||||||
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
|
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
|
||||||
|
|
||||||
-- Now we spawn the new group based on the template created.
|
-- Now we spawn the new group based on the template created.
|
||||||
_DATABASE:Spawn( GroupTemplate )
|
self.CargoObject = _DATABASE:Spawn( GroupTemplate )
|
||||||
|
|
||||||
self:SetWeight( WeightGroup )
|
self:SetWeight( WeightGroup )
|
||||||
self.CargoLimit = 10
|
self.CargoLimit = 10
|
||||||
@ -169,8 +169,11 @@ do -- CARGO_GROUP
|
|||||||
_DATABASE:Spawn( GroupTemplate )
|
_DATABASE:Spawn( GroupTemplate )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.CargoObject = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Regroup the cargo group into one group with multiple unit.
|
--- Regroup the cargo group into one group with multiple unit.
|
||||||
@ -209,12 +212,12 @@ do -- CARGO_GROUP
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Then we register the new group in the database
|
-- Then we register the new group in the database
|
||||||
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID)
|
self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID )
|
||||||
|
|
||||||
self:F( { "Regroup", GroupTemplate } )
|
self:F( { "Regroup", GroupTemplate } )
|
||||||
|
|
||||||
-- Now we spawn the new group based on the template created.
|
-- Now we spawn the new group based on the template created.
|
||||||
_DATABASE:Spawn( GroupTemplate )
|
self.CargoObject = _DATABASE:Spawn( GroupTemplate )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user