CarCalculator: Difference between revisions

From Automation Game Wiki
(Created page with "== Overview ==")
 
No edit summary
Line 1: Line 1:
== Overview ==
== Overview ==
CarCalculator is an embarrassment of poor design decisions and technical debt. But that is what you can end up with after a project of 10 years.
The CarCalculator passed into DoExport is an 'instance' of CCarCalculator. A Lua table behaving like a traditional class object of OOP Languages.
CarCalculator is comprised of a series of nested tables:
* CarCalculator.CarInfo --- The root table of information
** CarCalculator.CarInfo.PlatformInfo --- Table of Model Part Choices
** CarCalculator.CarInfo.TrimInfo --- Table of Trim Part Choices
*** CarCalculator.CarInfo.TrimInfo.Results --- Table of Calculated Results from Automations Simulations
*** CarCalculator.CarInfo.TrimInfo.EngineInfo --- The root table of engine information
* CarCalculator.EngineCalculator --- The EngineCalculator Instance for this Car
** CarCalculator.EngineCalculator.EngineInfo --- The same instance of the EngineInfo table that is also stored in CarInfo.TrimInfo

Revision as of 15:04, 3 November 2021

Overview

CarCalculator is an embarrassment of poor design decisions and technical debt. But that is what you can end up with after a project of 10 years.

The CarCalculator passed into DoExport is an 'instance' of CCarCalculator. A Lua table behaving like a traditional class object of OOP Languages.

CarCalculator is comprised of a series of nested tables:

  • CarCalculator.CarInfo --- The root table of information
    • CarCalculator.CarInfo.PlatformInfo --- Table of Model Part Choices
    • CarCalculator.CarInfo.TrimInfo --- Table of Trim Part Choices
      • CarCalculator.CarInfo.TrimInfo.Results --- Table of Calculated Results from Automations Simulations
      • CarCalculator.CarInfo.TrimInfo.EngineInfo --- The root table of engine information
  • CarCalculator.EngineCalculator --- The EngineCalculator Instance for this Car
    • CarCalculator.EngineCalculator.EngineInfo --- The same instance of the EngineInfo table that is also stored in CarInfo.TrimInfo