Skip to main content
Skip to main content

PlaceableSellingStation

PlaceableSellingStation

Description

Specialization for placeables

Functions

collectPickObjects

Description

Definition

collectPickObjects()

Arguments

anysuperFunc
anynode

Code

function PlaceableSellingStation:collectPickObjects(superFunc, node)
local spec = self.spec_sellingStation

local foundNode = false
for _, unloadTrigger in ipairs(spec.sellingStation.unloadTriggers) do
if node = = unloadTrigger.exactFillRootNode then
foundNode = true
break
end
end

if not foundNode then
superFunc( self , node)
end
end

getSellingStation

Description

Definition

getSellingStation()

Code

function PlaceableSellingStation:getSellingStation()
return self.spec_sellingStation.sellingStation
end

initSpecialization

Description

Definition

initSpecialization()

Code

function PlaceableSellingStation.initSpecialization()
g_storeManager:addSpecType( "sellingStationFillTypes" , "shopListAttributeIconInput" , SellingStation.loadSpecValueFillTypes, SellingStation.getSpecValueFillTypes, StoreSpecies.PLACEABLE)
end

loadFromXMLFile

Description

Definition

loadFromXMLFile()

Arguments

anyxmlFile
anykey

Code

function PlaceableSellingStation:loadFromXMLFile(xmlFile, key)
local spec = self.spec_sellingStation
spec.sellingStation:loadFromXMLFile(xmlFile, key)
end

onDelete

Description

Definition

onDelete()

Code

function PlaceableSellingStation:onDelete()
local spec = self.spec_sellingStation
if spec.sellingStation ~ = nil then
g_currentMission.storageSystem:removeUnloadingStation(spec.sellingStation, self )
g_currentMission.economyManager:removeSellingStation(spec.sellingStation)
spec.sellingStation:delete()
end
end

onFinalizePlacement

Description

Definition

onFinalizePlacement()

Code

function PlaceableSellingStation:onFinalizePlacement()
local spec = self.spec_sellingStation
spec.sellingStation:register( true )
g_currentMission.storageSystem:addUnloadingStation(spec.sellingStation, self )
g_currentMission.economyManager:addSellingStation(spec.sellingStation)
end

onLoad

Description

Called on loading

Definition

onLoad(table savegame)

Arguments

tablesavegamesavegame

Code

function PlaceableSellingStation:onLoad(savegame)
local spec = self.spec_sellingStation
local xmlFile = self.xmlFile

spec.sellingStation = SellingStation.new( self.isServer, self.isClient)
spec.sellingStation:load( self.components, xmlFile, "placeable.sellingStation" , self.customEnvironment, self.i3dMappings, self.components[ 1 ].node)
spec.sellingStation.owningPlaceable = self
end

onReadStream

Description

Definition

onReadStream()

Arguments

anystreamId
anyconnection

Code

function PlaceableSellingStation:onReadStream(streamId, connection)
local spec = self.spec_sellingStation

local sellingStationId = NetworkUtil.readNodeObjectId(streamId)
spec.sellingStation:readStream(streamId, connection)
g_client:finishRegisterObject(spec.sellingStation, sellingStationId)
end

onWriteStream

Description

Definition

onWriteStream()

Arguments

anystreamId
anyconnection

Code

function PlaceableSellingStation:onWriteStream(streamId, connection)
local spec = self.spec_sellingStation

NetworkUtil.writeNodeObjectId(streamId, NetworkUtil.getObjectId(spec.sellingStation))
spec.sellingStation:writeStream(streamId, connection)
g_server:registerObjectInStream(connection, spec.sellingStation)
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 PlaceableSellingStation.prerequisitesPresent(specializations)
return true
end

registerEventListeners

Description

Definition

registerEventListeners()

Arguments

anyplaceableType

Code

function PlaceableSellingStation.registerEventListeners(placeableType)
SpecializationUtil.registerEventListener(placeableType, "onLoad" , PlaceableSellingStation )
SpecializationUtil.registerEventListener(placeableType, "onDelete" , PlaceableSellingStation )
SpecializationUtil.registerEventListener(placeableType, "onFinalizePlacement" , PlaceableSellingStation )
SpecializationUtil.registerEventListener(placeableType, "onReadStream" , PlaceableSellingStation )
SpecializationUtil.registerEventListener(placeableType, "onWriteStream" , PlaceableSellingStation )
end

registerFunctions

Description

Definition

registerFunctions()

Arguments

anyplaceableType

Code

function PlaceableSellingStation.registerFunctions(placeableType)
SpecializationUtil.registerFunction(placeableType, "getSellingStation" , PlaceableSellingStation.getSellingStation)
end

registerOverwrittenFunctions

Description

Definition

registerOverwrittenFunctions()

Arguments

anyplaceableType

Code

function PlaceableSellingStation.registerOverwrittenFunctions(placeableType)
SpecializationUtil.registerOverwrittenFunction(placeableType, "collectPickObjects" , PlaceableSellingStation.collectPickObjects)
end

registerSavegameXMLPaths

Description

Definition

registerSavegameXMLPaths()

Arguments

anyschema
anybasePath

Code

function PlaceableSellingStation.registerSavegameXMLPaths(schema, basePath)
schema:setXMLSpecializationType( "SellingStation" )
SellingStation.registerSavegameXMLPaths(schema, basePath)
schema:setXMLSpecializationType()
end

registerXMLPaths

Description

Definition

registerXMLPaths()

Arguments

anyschema
anybasePath

Code

function PlaceableSellingStation.registerXMLPaths(schema, basePath)
schema:setXMLSpecializationType( "SellingStation" )
SellingStation.registerXMLPaths(schema, basePath .. ".sellingStation" )
schema:setXMLSpecializationType()
end

saveToXMLFile

Description

Definition

saveToXMLFile()

Arguments

anyxmlFile
anykey
anyusedModNames

Code

function PlaceableSellingStation:saveToXMLFile(xmlFile, key, usedModNames)
local spec = self.spec_sellingStation
spec.sellingStation:saveToXMLFile(xmlFile, key, usedModNames)
end