- Added check that cohorts cannot have the same name.
- Made clearer that cohorts cannot have the same name in the docs.
This commit is contained in:
Frank 2022-07-25 22:45:43 +02:00
parent ab00d9534d
commit 3bb36044c1
4 changed files with 14 additions and 8 deletions

View File

@ -57,7 +57,7 @@ FLOTILLA.version="0.1.0"
-- @param #FLOTILLA self
-- @param #string TemplateGroupName Name of the template group.
-- @param #number Ngroups Number of asset groups of this flotilla. Default 3.
-- @param #string FlotillaName Name of the flotilla, e.g. "VFA-37".
-- @param #string FlotillaName Name of the flotilla. Must be **unique**!
-- @return #FLOTILLA self
function FLOTILLA:New(TemplateGroupName, Ngroups, FlotillaName)

View File

@ -66,7 +66,7 @@ LEGION.version="0.3.4"
--- Create a new LEGION class object.
-- @param #LEGION self
-- @param #string WarehouseName Name of the warehouse STATIC or UNIT object representing the warehouse.
-- @param #string LegionName Name of the legion.
-- @param #string LegionName Name of the legion. Must be **unique**!
-- @return #LEGION self
function LEGION:New(WarehouseName, LegionName)
@ -396,11 +396,17 @@ end
-- @param Ops.Cohort#COHORT Cohort The cohort to be added.
-- @return #LEGION self
function LEGION:AddCohort(Cohort)
-- TODO: Check if this cohort is already part of the legion!
-- Add cohort to legion.
table.insert(self.cohorts, Cohort)
if self:IsCohort(Cohort.name) then
self:E(self.lid..string.format("ERROR: A cohort with name %s already exists in this legion. Cohorts must have UNIQUE names!"))
else
-- Add cohort to legion.
table.insert(self.cohorts, Cohort)
end
return self
end

View File

@ -56,7 +56,7 @@ PLATOON.version="0.1.0"
-- @param #PLATOON self
-- @param #string TemplateGroupName Name of the template group.
-- @param #number Ngroups Number of asset groups of this platoon. Default 3.
-- @param #string PlatoonName Name of the platoon, e.g. "VFA-37".
-- @param #string PlatoonName Name of the platoon. Must be **unique**!
-- @return #PLATOON self
function PLATOON:New(TemplateGroupName, Ngroups, PlatoonName)

View File

@ -93,7 +93,7 @@ SQUADRON.version="0.8.1"
-- @param #SQUADRON self
-- @param #string TemplateGroupName Name of the template group.
-- @param #number Ngroups Number of asset groups of this squadron. Default 3.
-- @param #string SquadronName Name of the squadron, e.g. "VFA-37".
-- @param #string SquadronName Name of the squadron, e.g. "VFA-37". Must be **unique**!
-- @return #SQUADRON self
function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName)