Finished manual gearbox

This commit is contained in:
Ivan Grachyov
2021-11-11 22:16:33 +05:00
parent f55c30c4d3
commit d73f424d7f
15 changed files with 588 additions and 62 deletions

View File

@@ -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