Reworking vehicle controller

This commit is contained in:
Ivan Grachyov
2021-11-12 20:47:12 +05:00
parent 1650ac9a6d
commit b5fb04cce8
7 changed files with 169 additions and 30 deletions

View File

@@ -22,7 +22,13 @@ function Vehicle:initialize(config)
self.clutch = Clutch:new(config.Clutch)
self.engine = Engine:new(config.Engine, self.clutch)
self.gearbox = GearboxFactory.create(config.Gearbox, self.clutch)
self.axles = table.map(config.Axles, function(config)
return Differential:new(config)
end)
self.gearbox = GearboxFactory.create(config.Gearbox, self.clutch, self.axles)
-- self.axles = table.map(config.Axles, function(config)
-- return Differential:new(config)
-- end)
@@ -30,7 +36,7 @@ function Vehicle:initialize(config)
-- return SystemsBuilder:create(config)
-- end)
self.components = {self.clutch, self.engine} -- , self.gearbox, self.clutch}
self.components = {self.clutch, self.engine, self.gearbox} -- , self.gearbox, self.clutch}
-- self.components = table.add(self.components, self.axles)
-- self.components = table.add(self.components, self.systems)