mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Implemented Cargo limits
Cargo is only allowed to be boarded or a route can only be done if the limit of the cargo has not been reached! A few additional methods have been added like IsDeployed. CARGO_GROUP gets the deployed status if it is transported.
This commit is contained in:
@@ -925,6 +925,7 @@ function CARGO_GROUP:New( CargoGroup, Type, Name, ReportRadius )
|
||||
self.CargoSet = SET_CARGO:New()
|
||||
|
||||
self.CargoObject = CargoGroup
|
||||
self:SetDeployed( false )
|
||||
|
||||
local WeightGroup = 0
|
||||
|
||||
@@ -1043,6 +1044,27 @@ function CARGO_GROUP:onafterBoarding( From, Event, To, CargoCarrier, NearRadius,
|
||||
|
||||
end
|
||||
|
||||
--- Get the amount of cargo units in the group.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #CARGO_GROUP
|
||||
function CARGO_GROUP:GetCount()
|
||||
return self.CargoSet:Count()
|
||||
end
|
||||
|
||||
--- Set the cargo as deployed
|
||||
-- @param #CARGO_GROUP self
|
||||
function CARGO_GROUP:SetDeployed( Deployed )
|
||||
self.Deployed = Deployed
|
||||
end
|
||||
|
||||
--- Is the cargo deployed
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @return #boolean
|
||||
function CARGO_GROUP:IsDeployed()
|
||||
return self.Deployed
|
||||
end
|
||||
|
||||
|
||||
--- Enter UnBoarding State.
|
||||
-- @param #CARGO_GROUP self
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
|
||||
Reference in New Issue
Block a user