Skip to main content
Skip to main content

FillTypeManager

FillTypeManager

Description

This class handles all fillTypes and fillTypeCategories

Parent

AbstractManager

Functions

addFillType

Description

Adds a new fillType

Definition

addFillType(table fillTypeDesc)

Arguments

tablefillTypeDescFill type description object

Return Values

tablesuccess

Code

function FillTypeManager:addFillType(fillTypeDesc)
local maxNumFillTypes = 2 ^ FillTypeManager.SEND_NUM_BITS - 1
if # self.fillTypes > = maxNumFillTypes then
Logging.error( "FillTypeManager.addFillType too many fill types.Only %d fill types are supported.Ignoring '%s'." , maxNumFillTypes, fillTypeDesc.name)
return false
end

fillTypeDesc.index = # self.fillTypes + 1

self.nameToFillType[fillTypeDesc.name] = fillTypeDesc
self.nameToIndex[fillTypeDesc.name] = fillTypeDesc.index
self.indexToName[fillTypeDesc.index] = fillTypeDesc.name
self.indexToTitle[fillTypeDesc.index] = fillTypeDesc.title
self.indexToFillType[fillTypeDesc.index] = fillTypeDesc
table.insert( self.fillTypes, fillTypeDesc)

return true
end

addFillTypeCategory

Description

Adds a new fillType category

Definition

addFillTypeCategory(string name, boolean isBaseType)

Arguments

stringnamefillType category index name
booleanisBaseTypeif true overriding existing categories is not allowed

Return Values

booleanfillTypeCategoryIndex

Code

function FillTypeManager:addFillTypeCategory(name, isBaseType)
if not ClassUtil.getIsValidIndexName(name) then
printWarning( "Warning: '" .. tostring(name) .. "' is not a valid name for a fillTypeCategory.Ignoring fillTypeCategory!" )
return nil
end

name = string.upper(name)

if isBaseType and self.nameToCategoryIndex[name] ~ = nil then
printWarning( "Warning:FillTypeCategory '" .. tostring(name) .. "' already exists.Ignoring fillTypeCategory!" )
return nil
end

local index = self.nameToCategoryIndex[name]
if index = = nil then
local categoryFillTypes = { }
index = # self.categories + 1
table.insert( self.categories, name)
self.categoryNameToFillTypes[name] = categoryFillTypes
self.categoryIndexToFillTypes[index] = categoryFillTypes
self.nameToCategoryIndex[name] = index
end

return index
end

addFillTypeConversion

Description

Add fill type to fill type conversion

Definition

addFillTypeConversion(integer converter, integer sourceFillTypeIndex, integer targetFillTypeIndex, float conversionFactor)

Arguments

integerconverterindex of converter
integersourceFillTypeIndexsource fill type index
integertargetFillTypeIndextarget fill type index
floatconversionFactorfactor of conversion

Code

function FillTypeManager:addFillTypeConversion(converter, sourceFillTypeIndex, targetFillTypeIndex, conversionFactor)
if converter ~ = nil and self.fillTypeConverters[converter] ~ = nil and sourceFillTypeIndex ~ = nil and targetFillTypeIndex ~ = nil then
self.fillTypeConverters[converter][sourceFillTypeIndex] = { targetFillTypeIndex = targetFillTypeIndex, conversionFactor = conversionFactor }
end
end

addFillTypeConverter

Description

Adds a new fill type converter

Definition

addFillTypeConverter(string name, boolean isBaseType)

Arguments

stringnamename
booleanisBaseTypeif true overriding existing converters is not allowed

Return Values

booleanindex

Code

function FillTypeManager:addFillTypeConverter(name, isBaseType)
if not ClassUtil.getIsValidIndexName(name) then
printWarning( "Warning: '" .. tostring(name) .. "' is not a valid name for a fillTypeConverter.Ignoring fillTypeConverter!" )
return nil
end

name = string.upper(name)

if isBaseType and self.nameToConverter[name] ~ = nil then
printWarning( "Warning:FillTypeConverter '" .. tostring(name) .. "' already exists.Ignoring FillTypeConverter!" )
return nil
end

local index = self.converterNameToIndex[name]
if index = = nil then
local converter = { }
table.insert( self.fillTypeConverters, converter)
self.converterNameToIndex[name] = # self.fillTypeConverters
self.nameToConverter[name] = converter
index = # self.fillTypeConverters
end

return index
end

addFillTypeToCategory

Description

Add fillType to category

Definition

addFillTypeToCategory(integer fillTypeIndex, integer categoryIndex)

Arguments

integerfillTypeIndexindex of fillType
integercategoryIndexindex of category

Return Values

integersuccesstrue if added else false

Code

function FillTypeManager:addFillTypeToCategory(fillTypeIndex, categoryIndex)
if categoryIndex ~ = nil and fillTypeIndex ~ = nil then
if self.categoryIndexToFillTypes[categoryIndex] ~ = nil then
-- category -> fillType
self.categoryIndexToFillTypes[categoryIndex][fillTypeIndex] = true

-- fillType -> categories
if self.fillTypeIndexToCategories[fillTypeIndex] = = nil then
self.fillTypeIndexToCategories[fillTypeIndex] = { }
end
self.fillTypeIndexToCategories[fillTypeIndex][categoryIndex] = true

return true
end
end
return false
end

assignCustomFillTypeTextureArraysFromTerrain

Description

Assigns fill type array textures to given node id using custom texture names

Definition

assignCustomFillTypeTextureArraysFromTerrain(integer nodeId, integer terrainRootNodeId, string diffuse, string normal, string height)

Arguments

integernodeIdnode id
integerterrainRootNodeIdterrain root node id
stringdiffusediffuse map custom texture name, or ""
stringnormalnormal map custom texture name, or ""
stringheightheight map custom texture name, or ""

Code

function FillTypeManager:assignCustomFillTypeTextureArraysFromTerrain(nodeId, terrainRootNodeId, diffuse, normal, height)
local material = getMaterial(nodeId, 0 )

material = setTerrainFillPlanesToMaterialCustom(terrainRootNodeId, material, diffuse, normal, height)

if material ~ = nil then
setMaterial(nodeId, material, 0 )
end
end

assignFillTypeTextureArraysFromTerrain

Description

Assigns fill type array textures to given node id

Definition

assignFillTypeTextureArraysFromTerrain(integer nodeId, integer terrainRootNodeId, boolean diffuse, boolean normal, boolean height)

Arguments

integernodeIdnode id
integerterrainRootNodeIdterrain root node id
booleandiffuseapply diffuse map (default is true)
booleannormalapply normal map (default is true)
booleanheightapply height map (default is true)

Code

function FillTypeManager:assignFillTypeTextureArraysFromTerrain(nodeId, terrainRootNodeId, diffuse, normal, height)
local material = getMaterial(nodeId, 0 )

material = setTerrainFillPlanesToMaterial(terrainRootNodeId, material, diffuse, normal, height)

if material ~ = nil then
setMaterial(nodeId, material, 0 )
end
end

constructFillTypeDistanceTextureArray

Description

Constructs fill types texture distance array

Definition

constructFillTypeDistanceTextureArray(integer terrainDetailHeightId, integer typeFirstChannel, integer typeNumChannels, table heightTypes)

Arguments

integerterrainDetailHeightIdid of terrain detail height node
integertypeFirstChannelfirst type channel
integertypeNumChannelsnum type channels
tableheightTypeslist of heightTypes

Return Values

tablesuccess

Code

function FillTypeManager:constructFillTypeDistanceTextureArray(terrainDetailHeightId, typeFirstChannel, typeNumChannels, heightTypes)
local distanceConstr = TerrainDetailDistanceConstructor.new(typeFirstChannel, typeNumChannels)

for i = 1 , #heightTypes do
local heightType = heightTypes[i]

local fillType = self.fillTypes[heightType.fillTypeIndex]
if fillType ~ = nil then
fillType:addDistanceTexture(distanceConstr, i - 1 )
end
end

return distanceConstr:finalize(terrainDetailHeightId)
end

constructTerrainFillLayers

Description

Constructs density map height type array textures to given node id

Definition

constructTerrainFillLayers(table heightTypes, entityId terrainRootNodeId)

Arguments

tableheightTypestable of density height map types
entityIdterrainRootNodeId

Return Values

entityIdsuccess

Code

function FillTypeManager:constructTerrainFillLayers(heightTypes, terrainRootNodeId)

clearTerrainFillLayers(terrainRootNodeId)

local curIndex = 1
for i = 1 , #heightTypes do
local heightType = heightTypes[i]

local fillType = self.fillTypes[heightType.fillTypeIndex]
if fillType ~ = nil then
if fillType:addTerrainFillLayer(terrainRootNodeId, curIndex) then
curIndex = curIndex + 1

if heightType.visualHeightMapping ~ = nil then
for i = 1 , #heightType.visualHeightMapping do
local mapping, nextMapping = heightType.visualHeightMapping[i], heightType.visualHeightMapping[i + 1 ]
if nextMapping ~ = nil then
setTerrainFillVisualHeight(g_currentMission.terrainDetailHeightId, fillType.textureArrayIndex, mapping.realValue, mapping.visualValue, nextMapping.realValue, nextMapping.visualValue)
else
setTerrainFillVisualHeight(g_currentMission.terrainDetailHeightId, fillType.textureArrayIndex, mapping.realValue, mapping.visualValue, nil , nil )
end
end
end
end
end
end

finalizeTerrainFillLayers(terrainRootNodeId)

return true
end

getConverterDataByName

Description

Returns converter data by given name

Definition

getConverterDataByName(string converterName)

Arguments

stringconverterNamename of converter

Return Values

stringconverterDataconverter data

Code

function FillTypeManager:getConverterDataByName(converterName)
return self.nameToConverter[converterName and string.upper(converterName)]
end

getFillTypeByIndex

Description

Gets a fillType by index

Definition

getFillTypeByIndex(integer index)

Arguments

integerindexthe fillType index

Return Values

integerfillTypethe fillType object

Code

function FillTypeManager:getFillTypeByIndex(index)
return self.fillTypes[index]
end

getFillTypeByName

Description

Gets a fillType by index name

Definition

getFillTypeByName(string name)

Arguments

stringnamethe fillType index name

Return Values

stringfillTypethe fillType object

Code

function FillTypeManager:getFillTypeByName(name)
if ClassUtil.getIsValidIndexName(name) then
return self.nameToFillType[ string.upper(name)]
end
return nil
end

getFillTypeIndexByName

Description

Gets a fillType index by name

Definition

getFillTypeIndexByName(string name)

Arguments

stringnamethe fillType index name

Return Values

stringfillTypeIndexthe fillType index

Code

function FillTypeManager:getFillTypeIndexByName(name)
return self.nameToIndex[name and string.upper(name)]
end

getFillTypeNameByIndex

Description

Gets a fillTypeName by index

Definition

getFillTypeNameByIndex(integer index)

Arguments

integerindexthe fillType index

Return Values

integerfillTypeNamethe fillType name

Code

function FillTypeManager:getFillTypeNameByIndex(index)
return self.indexToName[index]
end

getFillTypeNamesByIndices

Description

Gets an array of fillType names from an array of fillType indices

Definition

getFillTypeNamesByIndices(table indices)

Arguments

tableindicesset of fillType indices (keys are the fillType indices)

Return Values

tablearrayof fillType names

Code

function FillTypeManager:getFillTypeNamesByIndices(indices)
local names = { }
for fillTypeIndex in pairs(indices) do
table.insert(names, self.indexToName[fillTypeIndex])
end
return names
end

getFillTypes

Description

Gets a list of fillTypes

Definition

getFillTypes()

Return Values

tablefillTypeslist of fillTypes

Code

function FillTypeManager:getFillTypes()
return self.fillTypes
end

getFillTypesByCategoryNames

Description

Gets a list of fillTypes of the given category names

Definition

getFillTypesByCategoryNames(string names, string? warning, table? fillTypes)

Arguments

stringnamesstring of space separated fillType category names
string?warninga warning text shown if a category is not found
table?fillTypeslist of fillTypes to insert results to, if omitted new table is created

Return Values

table?fillTypeslist of fillTypes

Code

function FillTypeManager:getFillTypesByCategoryNames(names, warning, fillTypes)
fillTypes = fillTypes or { }

if names ~ = nil then
return self:getFillTypesByCategoryNamesList( string.split(names, " " ), warning, fillTypes)
end

return fillTypes
end

getFillTypesByNames

Description

Gets list of fillType indices from string of space separated fill type names

Definition

getFillTypesByNames(string names, string? warning, table? fillTypes)

Arguments

stringnamesstring of space separatated fill type names
string?warningwarning if fill type not found
table?fillTypeslist of fillTypes to insert results to, if omitted new table is created

Return Values

table?fillTypeslist of fillTypes

Code

function FillTypeManager:getFillTypesByNames(names, warning, fillTypes)
fillTypes = fillTypes or { }

if names ~ = nil then
local fillTypeNames = string.split(names, " " )
for _, name in pairs(fillTypeNames) do
name = string.upper(name)
local fillTypeIndex = self.nameToIndex[name]
if fillTypeIndex ~ = nil then
if fillTypeIndex ~ = FillType.UNKNOWN then
if not table.hasElement(fillTypes, fillTypeIndex) then
table.insert(fillTypes, fillTypeIndex)
end
end
else
if warning ~ = nil then
printWarning( string.format(warning, name))
end
end
end
end

return fillTypes
end

getFillTypesFromXML

Description

Definition

getFillTypesFromXML(XMLFile xmlFile, string categoryKey, string namesKey, boolean? requiresFillTypes)

Arguments

XMLFilexmlFile
stringcategoryKey
stringnamesKey
boolean?requiresFillTypes

Return Values

boolean?fillTypes

Code

function FillTypeManager:getFillTypesFromXML(xmlFile, categoryKey, namesKey, requiresFillTypes)
local fillTypes = { }
local fillTypeCategories = xmlFile:getValue(categoryKey)
local fillTypeNames = xmlFile:getValue(namesKey)
if fillTypeCategories ~ = nil and fillTypeNames = = nil then
fillTypes = g_fillTypeManager:getFillTypesByCategoryNames(fillTypeCategories, "Warning: '" .. xmlFile:getFilename() .. "' has invalid fillTypeCategory '%s'." )
elseif fillTypeCategories = = nil and fillTypeNames ~ = nil then
fillTypes = g_fillTypeManager:getFillTypesByNames(fillTypeNames, "Warning: '" .. xmlFile:getFilename() .. "' has invalid fillType '%s'." )
elseif fillTypeCategories ~ = nil and fillTypeNames ~ = nil then
Logging.xmlWarning(xmlFile, "fillTypeCategories and fillTypeNames are both set, only one of the two allowed" )
elseif requiresFillTypes ~ = nil and requiresFillTypes then
Logging.xmlWarning(xmlFile, "either the '%s' or '%s' attribute has to be set" , categoryKey, namesKey)
end
return fillTypes
end

getFillTypeTitleByIndex

Description

Gets a fillType title by index

Definition

getFillTypeTitleByIndex(integer index)

Arguments

integerindexthe fillType index

Return Values

integerfillTypeTitlethe localized fillType title

Code

function FillTypeManager:getFillTypeTitleByIndex(index)
return self.indexToTitle[index]
end

getIsFillTypeInCategory

Description

Gets if filltype is part of a category

Definition

getIsFillTypeInCategory(string fillTypeIndex, string categoryName)

Arguments

stringfillTypeIndexfillType index
stringcategoryName

Return Values

stringtrueif fillType is part of category

Code

function FillTypeManager:getIsFillTypeInCategory(fillTypeIndex, categoryName)
local catgegoy = self.nameToCategoryIndex[categoryName]
if catgegoy ~ = nil and self.fillTypeIndexToCategories[fillTypeIndex] then
return self.fillTypeIndexToCategories[fillTypeIndex][catgegoy] ~ = nil
end
return false
end

getPrioritizedEffectTypeByFillTypeIndex

Description

Returns the prioritized effect type by given fill type index

Definition

getPrioritizedEffectTypeByFillTypeIndex(integer index)

Arguments

integerindexthe fillType index

Return Values

integerclassname of effect type

Code

function FillTypeManager:getPrioritizedEffectTypeByFillTypeIndex(index)
local fillType = self.fillTypes[index]
return fillType and fillType.prioritizedEffectType
end

getSampleByFillType

Description

Returns sound sample of fill type

Definition

getSampleByFillType(integer fillType)

Arguments

integerfillTypefill type index

Return Values

integersamplesample

Code

function FillTypeManager:getSampleByFillType(fillType)
return self.fillTypeToSample[fillType]
end

getSmokeColorByFillTypeIndex

Description

Returns the smoke color by fill type index

Definition

getSmokeColorByFillTypeIndex(integer index, boolean fruitColor)

Arguments

integerindexthe fillType index
booleanfruitColoruse fruit color of defined

Return Values

booleancolorsmoke color

Code

function FillTypeManager:getSmokeColorByFillTypeIndex(index, fruitColor)
local fillType = self.fillTypes[index]
if fillType ~ = nil then
if not fruitColor then
return fillType.fillSmokeColor
else
return fillType.fruitSmokeColor or fillType.fillSmokeColor
end
end

return nil
end

getTextureArrayIndexByFillTypeIndex

Description

Returns texture array by fill type index (returns nil if not in texture array)

Definition

getTextureArrayIndexByFillTypeIndex(integer index)

Arguments

integerindexthe fillType index

Return Values

integertextureArrayIndexindex in texture array

Code

function FillTypeManager:getTextureArrayIndexByFillTypeIndex(index)
local fillType = self.fillTypes[index]
return fillType and fillType.textureArrayIndex
end

initDataStructures

Description

Initialize data structures

Definition

initDataStructures()

Code

function FillTypeManager:initDataStructures()
self.fillTypes = { }
self.nameToFillType = { }
self.indexToFillType = { }
self.nameToIndex = { }
self.indexToName = { }
self.indexToTitle = { }

self.fillTypeConverters = { }
self.converterNameToIndex = { }
self.nameToConverter = { }

self.categories = { }
self.nameToCategoryIndex = { }
self.categoryIndexToFillTypes = { }
self.categoryNameToFillTypes = { }
self.fillTypeIndexToCategories = { }

self.fillTypeSamples = { }
self.fillTypeToSample = { }

self.modsToLoad = { }

FillType = self.nameToIndex
FillTypeCategory = self.categories
end

loadDefaultTypes

Description

Definition

loadDefaultTypes()

Code

function FillTypeManager:loadDefaultTypes()
local xmlFile = loadXMLFile( "fillTypes" , "data/maps/maps_fillTypes.xml" )
self:loadFillTypes(xmlFile, nil , true , nil , false )
delete(xmlFile)
end

loadFillTypes

Description

Loads fillTypes

Definition

loadFillTypes(table|integer xmlFile, string baseDirectory, boolean isBaseType, string? customEnv, )

Arguments

tableintegerxmlFileXMLFile instance or xml handle
stringbaseDirectoryFor sourcing textures and sounds
booleanisBaseTypeIs basegame type
string?customEnvCustom environment
anyfinalizeType

Return Values

anysuccesssuccess

Code

function FillTypeManager:loadFillTypes(xmlFile, baseDirectory, isBaseType, customEnv, finalizeType)
if xmlFile = = nil or xmlFile = = 0 then
return false
end

if type(xmlFile) ~ = "table" then
xmlFile = XMLFile.wrap(xmlFile, FillTypeManager.xmlSchema)
end

local rootName = xmlFile:getRootName()

if isBaseType then
local unknownFillType = FillTypeDesc.new() -- FillType.UNKNOWN
unknownFillType.economy.sychronizeData = false
self:addFillType(unknownFillType)
end

for _, ftKey in xmlFile:iterator(rootName .. ".fillTypes.fillType" ) do
local name = xmlFile:getValue(ftKey .. "#name" )
if name ~ = nil then
name = string.upper(name)
if isBaseType and self.nameToFillType[name] ~ = nil then
Logging.warning( "FillType '%s' already exists.Ignoring fillType!" , name)
continue
end

local fillTypeDesc = self.nameToFillType[name]
if fillTypeDesc = = nil then
fillTypeDesc = FillTypeDesc.new()
end

if fillTypeDesc:loadFromXMLFile(xmlFile, ftKey, baseDirectory, customEnv) then
if self.nameToFillType[name] = = nil then
self:addFillType(fillTypeDesc)
end

if finalizeType = = true then
fillTypeDesc:finalize()
end
end
end
end

for _, ftCategoryKey in xmlFile:iterator(rootName .. ".fillTypeCategories.fillTypeCategory" ) do
local name = xmlFile:getValue(ftCategoryKey .. "#name" )
local fillTypesList = xmlFile:getValue(ftCategoryKey)
local fillTypeCategoryIndex = self:addFillTypeCategory(name, isBaseType)
if fillTypesList ~ = nil and fillTypeCategoryIndex ~ = nil then
for _, fillTypeName in ipairs(fillTypesList) do
local fillType = self:getFillTypeByName(fillTypeName)
if fillType ~ = nil then
if not self:addFillTypeToCategory(fillType.index, fillTypeCategoryIndex) then
Logging.warning( "Could not add fillType '" .. tostring(fillTypeName) .. "' to fillTypeCategory '" .. tostring(name) .. "'!" )
end
else
Logging.warning( "Unknown FillType '" .. tostring(fillTypeName) .. "' in fillTypeCategory '" .. tostring(name) .. "'!" )
end
end
end
end

for _, ftConverterKey in xmlFile:iterator(rootName .. ".fillTypeConverters.fillTypeConverter" ) do
local name = xmlFile:getValue(ftConverterKey .. "#name" )
local converter = self:addFillTypeConverter(name, isBaseType)
if converter ~ = nil then
for _, converterRuleKey in xmlFile:iterator(ftConverterKey .. ".converter" ) do
local from = xmlFile:getValue(converterRuleKey .. "#from" )
local to = xmlFile:getValue(converterRuleKey .. "#to" )
local factor = xmlFile:getValue(converterRuleKey .. "#factor" )

local sourceFillType = g_fillTypeManager:getFillTypeByName(from)
local targetFillType = g_fillTypeManager:getFillTypeByName(to)

if sourceFillType ~ = nil and targetFillType ~ = nil and factor ~ = nil then
self:addFillTypeConversion(converter, sourceFillType.index, targetFillType.index, factor)
end
end
end
end

for _, fillTypeSoundKey in xmlFile:iterator(rootName .. ".fillTypeSounds.fillTypeSound" ) do
local sample = g_soundManager:loadSampleFromXML(xmlFile, fillTypeSoundKey, "sound" , baseDirectory, getRootNode(), 0 , AudioGroup.VEHICLE, nil , nil )
if sample = = nil then
continue
end

local entry = {
sample = sample,
fillTypes = { } ,
}

local fillTypes = xmlFile:getValue(fillTypeSoundKey .. "#fillTypes" )
if fillTypes ~ = nil then

for _, fillTypeName in ipairs(fillTypes) do
local fillType = self:getFillTypeIndexByName(fillTypeName)
if fillType ~ = nil then
table.insert(entry.fillTypes, fillType)
self.fillTypeToSample[fillType] = sample
else
Logging.xmlWarning(xmlFile, "Unable to load fill type '%s' for fillTypeSound '%s'" , fillTypeName, fillTypeSoundKey)
end
end
end

if xmlFile:getValue(fillTypeSoundKey .. "#isDefault" ) then
for fillType, _ in ipairs( self.fillTypes) do
if self.fillTypeToSample[fillType] = = nil then
self.fillTypeToSample[fillType] = sample
end
end
end

table.insert( self.fillTypeSamples, entry)
end

return true
end

loadMapData

Description

Load data on map load

Definition

loadMapData(integer xmlFile, table missionInfo, string baseDirectory)

Arguments

integerxmlFile
tablemissionInfo
stringbaseDirectory

Return Values

stringtrueif loading was successful else false

Code

function FillTypeManager:loadMapData(xmlFile, missionInfo, baseDirectory)
FillTypeManager:superClass().loadMapData( self )

self:loadDefaultTypes()

if XMLUtil.loadDataFromMapXML(xmlFile, "fillTypes" , baseDirectory, self , self.loadFillTypes, baseDirectory, false , missionInfo.customEnvironment, false ) then
for _, fillType in ipairs( self.fillTypes) do
fillType:finalize()
end

return true
end

return false
end

loadModFillTypes

Description

Definition

loadModFillTypes()

Code

function FillTypeManager:loadModFillTypes()
if # self.modsToLoad > 0 then
-- Load additional fill types from mods
for _, data in ipairs( self.modsToLoad) do
local xmlFilename, baseDirectoryMod, customEnvironment = unpack(data)
local fillTypesXMLFile = XMLFile.load( "fillTypes" , xmlFilename, FillTypeManager.xmlSchema)
if fillTypesXMLFile ~ = nil then
local numFillTypes = # self.fillTypes
g_fillTypeManager:loadFillTypes(fillTypesXMLFile, baseDirectoryMod, false , customEnvironment, false )
fillTypesXMLFile:delete()

local numLoadedFillTypes = # self.fillTypes - numFillTypes
if numLoadedFillTypes > 0 then
Logging.info( "Loaded %d fill types from mod: %s" , numLoadedFillTypes, customEnvironment)
end
end
end

for _, fillType in ipairs( self.fillTypes) do
fillType:finalize()
end
end
end

new

Description

Creating manager

Definition

new(table? customMt)

Arguments

table?customMt

Return Values

table?instanceinstance of object

Code

function FillTypeManager.new(customMt)
local self = AbstractManager.new(customMt or FillTypeManager _mt)
return self
end

unloadMapData

Description

Definition

unloadMapData()

Code

function FillTypeManager:unloadMapData()
for _, sample in pairs( self.fillTypeSamples) do
g_soundManager:deleteSample(sample.sample)
end

for _, fillTypeDesc in pairs( self.fillTypes) do
fillTypeDesc:delete()
end

FillTypeManager:superClass().unloadMapData( self )
end