diff --git a/Moose Development/Moose/Ops/Flotilla.lua b/Moose Development/Moose/Ops/Flotilla.lua index 55e44e9b6..adc13b73e 100644 --- a/Moose Development/Moose/Ops/Flotilla.lua +++ b/Moose Development/Moose/Ops/Flotilla.lua @@ -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) diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index 01e35dc3b..366d6a7d5 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -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 diff --git a/Moose Development/Moose/Ops/Platoon.lua b/Moose Development/Moose/Ops/Platoon.lua index 6d6a3e87a..8b380a134 100644 --- a/Moose Development/Moose/Ops/Platoon.lua +++ b/Moose Development/Moose/Ops/Platoon.lua @@ -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) diff --git a/Moose Development/Moose/Ops/Squadron.lua b/Moose Development/Moose/Ops/Squadron.lua index e720de2cc..dc2188a3e 100644 --- a/Moose Development/Moose/Ops/Squadron.lua +++ b/Moose Development/Moose/Ops/Squadron.lua @@ -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)