Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Applevangelist 2023-06-18 12:19:37 +02:00
commit 1cdbe55cdd
3 changed files with 20 additions and 9 deletions

View File

@ -114,6 +114,9 @@
-- @field #number NcarriersMax Max number of required carrier assets. -- @field #number NcarriersMax Max number of required carrier assets.
-- @field Core.Zone#ZONE transportDeployZone Deploy zone of an OPSTRANSPORT. -- @field Core.Zone#ZONE transportDeployZone Deploy zone of an OPSTRANSPORT.
-- @field Core.Zone#ZONE transportDisembarkZone Disembark zone of an OPSTRANSPORT. -- @field Core.Zone#ZONE transportDisembarkZone Disembark zone of an OPSTRANSPORT.
-- @param #table carrierCategories Transport group categories.
-- @field #table carrierAttributes Generalized attribute(s) of transport assets.
-- @field #table carrierProperties DCS attribute(s) of transport assets.
-- --
-- @field #number artyRadius Radius in meters. -- @field #number artyRadius Radius in meters.
-- @field #number artyShots Number of shots fired. -- @field #number artyShots Number of shots fired.
@ -3056,15 +3059,18 @@ end
-- @param #number NcarriersMin Number of carriers *at least* required. Default 1. -- @param #number NcarriersMin Number of carriers *at least* required. Default 1.
-- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`.
-- @param Core.Zone#ZONE DisembarkZone Zone where assets are disembarked to. -- @param Core.Zone#ZONE DisembarkZone Zone where assets are disembarked to.
-- @param #table Categories Group categories.
-- @param #table Attributes Generalizes group attributes.
-- @param #table Properties DCS attributes.
-- @return #AUFTRAG self -- @return #AUFTRAG self
function AUFTRAG:SetRequiredTransport(DeployZone, NcarriersMin, NcarriersMax, DisembarkZone) function AUFTRAG:SetRequiredTransport(DeployZone, NcarriersMin, NcarriersMax, DisembarkZone, Categories, Attributes, Properties)
-- OPS transport from pickup to deploy zone. -- OPS transport from pickup to deploy zone.
self.transportDeployZone=DeployZone self.transportDeployZone=DeployZone
self.transportDisembarkZone=DisembarkZone self.transportDisembarkZone=DisembarkZone
-- Set required carriers. -- Set required carriers.
self:SetRequiredCarriers(NcarriersMin, NcarriersMax) self:SetRequiredCarriers(NcarriersMin, NcarriersMax, Categories, Attributes, Properties)
return self return self
end end
@ -3115,8 +3121,11 @@ end
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @param #number NcarriersMin Number of carriers *at least* required. Default 1. -- @param #number NcarriersMin Number of carriers *at least* required. Default 1.
-- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`.
-- @param #table Categories Group categories.
-- @param #table Attributes Group attributes. See `GROUP.Attribute.`
-- @param #table Properties DCS attributes.
-- @return #AUFTRAG self -- @return #AUFTRAG self
function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax) function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax, Categories, Attributes, Properties)
self.NcarriersMin=NcarriersMin or 1 self.NcarriersMin=NcarriersMin or 1
@ -3127,6 +3136,10 @@ function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax)
self.NcarriersMax=self.NcarriersMin self.NcarriersMax=self.NcarriersMin
end end
self.carrierCategories = UTILS.EnsureTable(Categories, true)
self.carrierAttributes = UTILS.EnsureTable(Attributes, true)
self.carrierProperties = UTILS.EnsureTable(Properties, true)
return self return self
end end

View File

@ -1508,7 +1508,7 @@ function COMMANDER:CheckMissionQueue()
local Transport=nil local Transport=nil
local Legions=mission.transportLegions or self.legions local Legions=mission.transportLegions or self.legions
TransportAvail, Transport=LEGION.AssignAssetsForTransport(self, Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone) TransportAvail, Transport=LEGION.AssignAssetsForTransport(self, Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone, mission.carrierCategories, mission.carrierAttributes, mission.carrierProperties)
-- Add opstransport to mission. -- Add opstransport to mission.
if TransportAvail and Transport then if TransportAvail and Transport then
@ -1702,8 +1702,7 @@ function COMMANDER:RecruitAssetsForMission(Mission)
local cohort=_cohort --Ops.Cohort#COHORT local cohort=_cohort --Ops.Cohort#COHORT
-- Check if cohort can perform transport to target. -- Check if cohort can perform transport to target.
--TODO: Option to filter transport carrier asset categories, attributes and/or properties. local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Mission.carrierCategories, Mission.carrierAttributes, Mission.carrierProperties, nil, TargetVec2)
local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Categories, Attributes, Properties, nil, TargetVec2)
-- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos. -- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos.
if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then

View File

@ -714,7 +714,7 @@ function LEGION:CheckMissionQueue()
local Legions=mission.transportLegions or {self} local Legions=mission.transportLegions or {self}
-- Assign carrier assets for transport. -- Assign carrier assets for transport.
TransportAvail, Transport=self:AssignAssetsForTransport(Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone) TransportAvail, Transport=self:AssignAssetsForTransport(Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone, mission.carrierCategories, mission.carrierAttributes, mission.carrierProperties)
end end
-- Add opstransport to mission. -- Add opstransport to mission.
@ -2252,8 +2252,7 @@ function LEGION:RecruitAssetsForMission(Mission)
local cohort=_cohort --Ops.Cohort#COHORT local cohort=_cohort --Ops.Cohort#COHORT
-- Check if cohort can perform transport to target. -- Check if cohort can perform transport to target.
--TODO: Option to filter transport carrier asset categories, attributes and/or properties. local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Mission.carrierCategories, Mission.carrierAttributes, Mission.carrierProperties, nil, TargetVec2)
local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Categories, Attributes, Properties, nil, TargetVec2)
-- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos. -- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos.
if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then