Skip to main content
Skip to main content

PlaceableWeatherStation

PlaceableWeatherStation

Description

Specialization for placeables

Functions

onDelete

Description

Definition

onDelete()

Code

function PlaceableWeatherStation:onDelete()
g_currentMission.placeableSystem:removeWeatherStation( self )

if self.isClient then
local spec = self.spec_weatherStation
g_soundManager:deleteSample(spec.sample)
end
end

onFinalizePlacement

Description

Definition

onFinalizePlacement()

Code

function PlaceableWeatherStation:onFinalizePlacement()
g_currentMission.placeableSystem:addWeatherStation( self )

if self.isClient then
local spec = self.spec_weatherStation
if spec.sample ~ = nil then
g_soundManager:playSample(spec.sample)
end
end
end

onLoad

Description

Called on loading

Definition

onLoad(table savegame)

Arguments

tablesavegamesavegame

Code

function PlaceableWeatherStation:onLoad(savegame)
local spec = self.spec_weatherStation

if self.isClient then
spec.sample = g_soundManager:loadSampleFromXML( self.xmlFile, "placeable.weatherStation.sounds" , "idle" , self.baseDirectory, self.components, 0 , AudioGroup.ENVIRONMENT, self.i3dMappings, nil )
end
end

prerequisitesPresent

Description

Checks if all prerequisite specializations are loaded

Definition

prerequisitesPresent(table specializations)

Arguments

tablespecializationsspecializations

Return Values

tablehasPrerequisitetrue if all prerequisite specializations are loaded

Code

function PlaceableWeatherStation.prerequisitesPresent(specializations)
return true
end

registerEventListeners

Description

Definition

registerEventListeners()

Arguments

anyplaceableType

Code

function PlaceableWeatherStation.registerEventListeners(placeableType)
SpecializationUtil.registerEventListener(placeableType, "onLoad" , PlaceableWeatherStation )
SpecializationUtil.registerEventListener(placeableType, "onDelete" , PlaceableWeatherStation )
SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement" , PlaceableWeatherStation )
end

registerXMLPaths

Description

Definition

registerXMLPaths()

Arguments

anyschema
anybasePath

Code

function PlaceableWeatherStation.registerXMLPaths(schema, basePath)
schema:setXMLSpecializationType( "WeatherStation" )

SoundManager.registerSampleXMLPaths(schema, basePath .. ".weatherStation.sounds" , "idle" )

schema:setXMLSpecializationType()
end