boku-ilen/landscapelab

Refactor all configuration-related code to use reflection instead of parsing into fixed structures

kb173 opened this issue · 0 comments

Currently most of the .ll config is parsed into classes like RenderInfo. This means that when adding a new variable, changes must be made in the LayerRenderer, the RenderInfo, and the config. Over time we realized that this detour over the RenderInfo is not needed anymore: we could also just use the LayerRenderer as the "ground truth" of configurable variables directly, and simply load all variables found in the attributes section of an entry in the .ll config right into the renderer. That way, additional variables are easier to add, with the small drawback of having no centralized place where all the config is defined.

We already do this in some cases, e.g. in the Game System's AttributeMappings which have an explicit reflections entry. I suggest we gradually refactor the code towards this in the future.