Reworking vehicle controller
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user