diff --git a/Moose/Base.lua b/Moose/Base.lua index 3eb5acd45..c96e27047 100644 --- a/Moose/Base.lua +++ b/Moose/Base.lua @@ -353,6 +353,7 @@ end -- @param #number Level function BASE:TraceLevel( Level ) _TraceLevel = Level + self:E( "Tracing level " .. Level ) end --- Set tracing for a class @@ -361,6 +362,7 @@ end function BASE:TraceClass( Class ) _TraceClass[Class] = true _TraceClassMethod[Class] = {} + self:E( "Tracing class " .. Class ) end --- Set tracing for a specific method of class @@ -373,6 +375,7 @@ function BASE:TraceClassMethod( Class, Method ) _TraceClassMethod[Class].Method = {} end _TraceClassMethod[Class].Method[Method] = true + self:E( "Tracing method " .. Method .. " of class " .. Class ) end --- Trace a function call. Must be at the beginning of the function logic. diff --git a/Moose/Database.lua b/Moose/Database.lua index a0c915eda..de4082c06 100644 --- a/Moose/Database.lua +++ b/Moose/Database.lua @@ -282,6 +282,9 @@ end -- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined: -- SpawnCountryID, SpawnCategoryID -- This method is used by the SPAWN class. +-- @param #DATABASE self +-- @param #table SpawnTemplate +-- @return #DATABASE self function DATABASE:Spawn( SpawnTemplate ) self:F( SpawnTemplate.name ) @@ -330,7 +333,10 @@ function DATABASE:GetStatusGroup( GroupName ) end end ---- Registers new Group Templates within the DATABASE Object. +--- Private method that registers new Group Templates within the DATABASE Object. +-- @param #DATABASE self +-- @param #table GroupTemplate +-- @return #DATABASE self function DATABASE:_RegisterGroup( GroupTemplate ) local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name) diff --git a/Moose/Spawn.lua b/Moose/Spawn.lua index 35241ac0d..253d08868 100644 --- a/Moose/Spawn.lua +++ b/Moose/Spawn.lua @@ -456,6 +456,8 @@ function SPAWN:SpawnWithIndex( SpawnIndex ) if self.RepeatOnEngineShutDown then _EVENTDISPATCHER:OnEngineShutDownForTemplate( self.SpawnGroups[self.SpawnIndex].SpawnTemplate, self._OnEngineShutDown, self ) end + + self:T( self.SpawnGroups[self.SpawnIndex].SpawnTemplate ) self.SpawnGroups[self.SpawnIndex].Group = _DATABASE:Spawn( self.SpawnGroups[self.SpawnIndex].SpawnTemplate ) @@ -907,7 +909,6 @@ function SPAWN:_InitializeSpawnGroups( SpawnIndex ) self.SpawnGroups[SpawnIndex].Visible = false self.SpawnGroups[SpawnIndex].Spawned = false self.SpawnGroups[SpawnIndex].UnControlled = false - self.SpawnGroups[SpawnIndex].Spawned = false self.SpawnGroups[SpawnIndex].SpawnTime = 0 self.SpawnGroups[SpawnIndex].SpawnTemplatePrefix = self.SpawnTemplatePrefix @@ -961,6 +962,9 @@ end --- Gets the Group Template from the ME environment definition. -- This method used the @{DATABASE} object, which contains ALL initial and new spawned object in MOOSE. +-- @param #SPAWN self +-- @param #string SpawnTemplatePrefix +-- @return @SPAWN self function SPAWN:_GetTemplate( SpawnTemplatePrefix ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnTemplatePrefix } ) @@ -981,6 +985,10 @@ function SPAWN:_GetTemplate( SpawnTemplatePrefix ) end --- Prepares the new Group Template. +-- @param #SPAWN self +-- @param #string SpawnTemplatePrefix +-- @param #number SpawnIndex +-- @return #SPAWN self function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix } ) @@ -991,6 +999,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) SpawnTemplate.lateActivation = false if SpawnTemplate.SpawnCategoryID == Group.Category.GROUND then + self:T( "For ground units, visible needs to be false..." ) SpawnTemplate.visible = false end @@ -1010,7 +1019,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) end ---- Internal function randomizing the routes. +--- Private method randomizing the routes. -- @param #SPAWN self -- @param #number SpawnIndex The index of the group to be spawned. -- @return #SPAWN @@ -1034,7 +1043,10 @@ function SPAWN:_RandomizeRoute( SpawnIndex ) return self end - +--- Private method that randomizes the template of the group. +-- @param #SPAWN self +-- @param #number SpawnIndex +-- @return #SPAWN self function SPAWN:_RandomizeTemplate( SpawnIndex ) self:F( { self.SpawnTemplatePrefix, SpawnIndex } )