Skip to main content
Skip to main content

VehicleConfigurationItemMotor

VehicleConfigurationItemMotor

Description

Stores the data for motor configurations

Parent

VehicleConfigurationItem

Functions

loadFromXML

Description

Definition

loadFromXML()

Arguments

anyxmlFile
anybaseKey
anyconfigKey
anybaseDirectory
anycustomEnvironment

Code

function VehicleConfigurationItemMotor:loadFromXML(xmlFile, baseKey, configKey, baseDirectory, customEnvironment)
if not VehicleConfigurationItemMotor:superClass().loadFromXML( self , xmlFile, baseKey, configKey, baseDirectory, customEnvironment) then
return false
end

self.power = xmlFile:getValue(configKey .. "#hp" )
self.maxSpeed = xmlFile:getValue(configKey .. "#maxSpeed" )
self.consumerConfigurationIndex = xmlFile:getValue(configKey .. "#consumerConfigurationIndex" )

return true
end

new

Description

Definition

new()

Arguments

anyconfigName
anycustomMt

Code

function VehicleConfigurationItemMotor.new(configName, customMt)
local self = VehicleConfigurationItemMotor:superClass().new(configName, VehicleConfigurationItemMotor _mt)

return self
end

registerXMLPaths

Description

Definition

registerXMLPaths()

Arguments

anyschema
anyrootPath
anyconfigPath

Code

function VehicleConfigurationItemMotor.registerXMLPaths(schema, rootPath, configPath)
VehicleConfigurationItemMotor:superClass().registerXMLPaths(schema, rootPath, configPath)

schema:register(XMLValueType.FLOAT, configPath .. "#hp" , "Horse power to be shown in the shop" )
schema:register(XMLValueType.FLOAT, configPath .. "#maxSpeed" , "Max.speed to be shown in the shop" )
schema:register(XMLValueType.INT, configPath .. "#consumerConfigurationIndex" , "Index of consumer configuration to be used" )
end