2021-11-09 22:32:12 +05:00

38 lines
635 B
Plaintext

Gearbox = class("Gearbox")
function Gearbox:initialize(options)
options = options or {}
self.ratios = options.Ratios
self.finalDrive = options.FinalDrive
self.reverse = options.Reverse
self.gear = 0
self._linkedDiffs = {}
self._clutch = nil
end
function Gearbox:linkDiff(diff)
table.insert(self._linkedDiffs, diff)
end
function Gearbox:shift(dir)
end
function Gearbox:setGear(gear)
if gear >= -1 and gear <= #self.ratios then
self.gear = gear
end
end
function Gearbox:linkClutch(clutch)
self._clutch = clutch
clutch:linkGearbox(self)
end
function Gearbox:update()
end