Skip to main content
Skip to main content

PlaceableWorkshop

PlaceableWorkshop

Description

Specialization for placeables

Functions

onDelete

Description

Definition

onDelete()

Code

function PlaceableWorkshop:onDelete()
local spec = self.spec_workshop

if spec.sellingPoint ~ = nil then
spec.sellingPoint:delete()
end
end

onLoad

Description

Called on loading

Definition

onLoad(table savegame)

Arguments

tablesavegamesavegame

Code

function PlaceableWorkshop:onLoad(savegame)
local spec = self.spec_workshop

spec.sellingPoint = VehicleSellingPoint.new()
spec.sellingPoint:load( self.components, self.xmlFile, "placeable.workshop.sellingPoint" , self.i3dMappings)
spec.sellingPoint:setOwnerFarmId( self:getOwnerFarmId())
spec.sellingPoint.owningPlaceable = self
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 PlaceableWorkshop.prerequisitesPresent(specializations)
return true
end

registerEventListeners

Description

Definition

registerEventListeners()

Arguments

anyplaceableType

Code

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

registerOverwrittenFunctions

Description

Definition

registerOverwrittenFunctions()

Arguments

anyplaceableType

Code

function PlaceableWorkshop.registerOverwrittenFunctions(placeableType)
SpecializationUtil.registerOverwrittenFunction(placeableType, "setOwnerFarmId" , PlaceableWorkshop.setOwnerFarmId)
end

registerXMLPaths

Description

Definition

registerXMLPaths()

Arguments

anyschema
anybasePath

Code

function PlaceableWorkshop.registerXMLPaths(schema, basePath)
schema:setXMLSpecializationType( "Workshop" )
VehicleSellingPoint.registerXMLPaths(schema, basePath .. ".workshop.sellingPoint" )
schema:setXMLSpecializationType()
end

setOwnerFarmId

Description

Definition

setOwnerFarmId()

Arguments

anysuperFunc
anyownerFarmId
anynoEventSend

Code

function PlaceableWorkshop:setOwnerFarmId(superFunc, ownerFarmId, noEventSend)
local spec = self.spec_workshop

superFunc( self , ownerFarmId, noEventSend)

if spec.sellingPoint ~ = nil then
spec.sellingPoint:setOwnerFarmId(ownerFarmId)
end
end