Skip to main content
Skip to main content

BunkerSiloInteractor

BunkerSiloInteractor

Description

Specialization for connecting bunker silo callbacks with vehicles

Functions

notifiyBunkerSilo

Description

Definition

notifiyBunkerSilo()

Arguments

anychangedFillLevel
anyfillType
anyx
anyy
anyz

Code

function BunkerSiloInteractor:notifiyBunkerSilo(changedFillLevel, fillType, x, y, z)
local spec = self.spec_bunkerSiloInteractor
if spec.callback ~ = nil then
spec.callback(spec.callbackTarget, self , changedFillLevel, fillType, x, y, z)
end
end

onLoad

Description

Definition

onLoad()

Arguments

anysavegame

Code

function BunkerSiloInteractor:onLoad(savegame)
local spec = self.spec_bunkerSiloInteractor

spec.callback = nil
spec.callbackTarget = nil
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 BunkerSiloInteractor.prerequisitesPresent(specializations)
return true
end

registerEventListeners

Description

Definition

registerEventListeners()

Arguments

anyvehicleType

Code

function BunkerSiloInteractor.registerEventListeners(vehicleType)
SpecializationUtil.registerEventListener(vehicleType, "onLoad" , BunkerSiloInteractor )
end

registerFunctions

Description

Definition

registerFunctions()

Arguments

anyvehicleType

Code

function BunkerSiloInteractor.registerFunctions(vehicleType)
SpecializationUtil.registerFunction(vehicleType, "setBunkerSiloInteractorCallback" , BunkerSiloInteractor.setBunkerSiloInteractorCallback)
SpecializationUtil.registerFunction(vehicleType, "notifiyBunkerSilo" , BunkerSiloInteractor.notifiyBunkerSilo)
end

setBunkerSiloInteractorCallback

Description

Set fill level changed callback (e.g. by bunker silo)

Definition

setBunkerSiloInteractorCallback(function callback, table callbackTarget)

Arguments

functioncallbackcallback
tablecallbackTargetcallback target

Code

function BunkerSiloInteractor:setBunkerSiloInteractorCallback(callback, callbackTarget)
local spec = self.spec_bunkerSiloInteractor
spec.callback = callback
spec.callbackTarget = callbackTarget
end