Anapa airbase fixes

This commit is contained in:
svenvandevelde 2016-05-06 10:12:30 +02:00
parent f8a5ebdadb
commit 4adf5aa188
3 changed files with 25 additions and 4 deletions

View File

@ -353,6 +353,7 @@ end
-- @param #number Level -- @param #number Level
function BASE:TraceLevel( Level ) function BASE:TraceLevel( Level )
_TraceLevel = Level _TraceLevel = Level
self:E( "Tracing level " .. Level )
end end
--- Set tracing for a class --- Set tracing for a class
@ -361,6 +362,7 @@ end
function BASE:TraceClass( Class ) function BASE:TraceClass( Class )
_TraceClass[Class] = true _TraceClass[Class] = true
_TraceClassMethod[Class] = {} _TraceClassMethod[Class] = {}
self:E( "Tracing class " .. Class )
end end
--- Set tracing for a specific method of class --- Set tracing for a specific method of class
@ -373,6 +375,7 @@ function BASE:TraceClassMethod( Class, Method )
_TraceClassMethod[Class].Method = {} _TraceClassMethod[Class].Method = {}
end end
_TraceClassMethod[Class].Method[Method] = true _TraceClassMethod[Class].Method[Method] = true
self:E( "Tracing method " .. Method .. " of class " .. Class )
end end
--- Trace a function call. Must be at the beginning of the function logic. --- Trace a function call. Must be at the beginning of the function logic.

View File

@ -282,6 +282,9 @@ end
-- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined: -- This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined:
-- SpawnCountryID, SpawnCategoryID -- SpawnCountryID, SpawnCategoryID
-- This method is used by the SPAWN class. -- This method is used by the SPAWN class.
-- @param #DATABASE self
-- @param #table SpawnTemplate
-- @return #DATABASE self
function DATABASE:Spawn( SpawnTemplate ) function DATABASE:Spawn( SpawnTemplate )
self:F( SpawnTemplate.name ) self:F( SpawnTemplate.name )
@ -330,7 +333,10 @@ function DATABASE:GetStatusGroup( GroupName )
end end
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 ) function DATABASE:_RegisterGroup( GroupTemplate )
local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name) local GroupTemplateName = env.getValueDictByKey(GroupTemplate.name)

View File

@ -456,6 +456,8 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
if self.RepeatOnEngineShutDown then if self.RepeatOnEngineShutDown then
_EVENTDISPATCHER:OnEngineShutDownForTemplate( self.SpawnGroups[self.SpawnIndex].SpawnTemplate, self._OnEngineShutDown, self ) _EVENTDISPATCHER:OnEngineShutDownForTemplate( self.SpawnGroups[self.SpawnIndex].SpawnTemplate, self._OnEngineShutDown, self )
end end
self:T( self.SpawnGroups[self.SpawnIndex].SpawnTemplate )
self.SpawnGroups[self.SpawnIndex].Group = _DATABASE:Spawn( 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].Visible = false
self.SpawnGroups[SpawnIndex].Spawned = false self.SpawnGroups[SpawnIndex].Spawned = false
self.SpawnGroups[SpawnIndex].UnControlled = false self.SpawnGroups[SpawnIndex].UnControlled = false
self.SpawnGroups[SpawnIndex].Spawned = false
self.SpawnGroups[SpawnIndex].SpawnTime = 0 self.SpawnGroups[SpawnIndex].SpawnTime = 0
self.SpawnGroups[SpawnIndex].SpawnTemplatePrefix = self.SpawnTemplatePrefix self.SpawnGroups[SpawnIndex].SpawnTemplatePrefix = self.SpawnTemplatePrefix
@ -961,6 +962,9 @@ end
--- Gets the Group Template from the ME environment definition. --- 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. -- 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 ) function SPAWN:_GetTemplate( SpawnTemplatePrefix )
self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnTemplatePrefix } ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnTemplatePrefix } )
@ -981,6 +985,10 @@ function SPAWN:_GetTemplate( SpawnTemplatePrefix )
end end
--- Prepares the new Group Template. --- Prepares the new Group Template.
-- @param #SPAWN self
-- @param #string SpawnTemplatePrefix
-- @param #number SpawnIndex
-- @return #SPAWN self
function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix } ) self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix } )
@ -991,6 +999,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
SpawnTemplate.lateActivation = false SpawnTemplate.lateActivation = false
if SpawnTemplate.SpawnCategoryID == Group.Category.GROUND then if SpawnTemplate.SpawnCategoryID == Group.Category.GROUND then
self:T( "For ground units, visible needs to be false..." )
SpawnTemplate.visible = false SpawnTemplate.visible = false
end end
@ -1010,7 +1019,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
end end
--- Internal function randomizing the routes. --- Private method randomizing the routes.
-- @param #SPAWN self -- @param #SPAWN self
-- @param #number SpawnIndex The index of the group to be spawned. -- @param #number SpawnIndex The index of the group to be spawned.
-- @return #SPAWN -- @return #SPAWN
@ -1034,7 +1043,10 @@ function SPAWN:_RandomizeRoute( SpawnIndex )
return self return self
end end
--- Private method that randomizes the template of the group.
-- @param #SPAWN self
-- @param #number SpawnIndex
-- @return #SPAWN self
function SPAWN:_RandomizeTemplate( SpawnIndex ) function SPAWN:_RandomizeTemplate( SpawnIndex )
self:F( { self.SpawnTemplatePrefix, SpawnIndex } ) self:F( { self.SpawnTemplatePrefix, SpawnIndex } )