Finished manual gearbox
This commit is contained in:
@@ -1,17 +1,40 @@
|
||||
-- @include ./base.txt
|
||||
require("./base.txt")
|
||||
require('./base.txt')
|
||||
|
||||
ManualGearbox = class("ManualGearbox")
|
||||
ManualGearbox = class('ManualGearbox')
|
||||
|
||||
function ManualGearbox:initialize(options)
|
||||
options = options or {}
|
||||
|
||||
-- might want to segregate construction options for base gearbox
|
||||
self.base = Gearbox:new(options)
|
||||
self.torque = 0
|
||||
self.rpm = 0
|
||||
self.gear = 0
|
||||
self.ratio = 0
|
||||
end
|
||||
|
||||
function ManualGearbox:linkClutch(clutch)
|
||||
return self.base:linkClutch(clutch)
|
||||
end
|
||||
|
||||
-- proxy the methods here
|
||||
function ManualGearbox:linkDiff(diff)
|
||||
return self.base:linkDiff(diff)
|
||||
end
|
||||
|
||||
function ManualGearbox:shift(dir)
|
||||
return self.base:shift(dir)
|
||||
end
|
||||
|
||||
function ManualGearbox:setGear(gear)
|
||||
return self.base:setGear(gear)
|
||||
end
|
||||
|
||||
function ManualGearbox:update()
|
||||
self.base:update()
|
||||
|
||||
self.rpm = self.base.rpm
|
||||
self.torque = self.base.torque
|
||||
self.gear = self.base.gear
|
||||
self.ratio = self.base.ratio
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user