Having updated the DED parser with new
DEDRegister based storage for model definitions, this first step of revising model definitions seems to be going well.
While Records are Doomsday Script objects, the model definitions are predominantly used by native code. This calls for a light native wrapper class that provides some utility methods for manipulating the variables in the definition. This is particularly helpful with sub-models, as they are stored in an
ArrayValue that would be cumbersome to manipulate directly.
Thanks to C++ function overloading, I managed to update the parser with minimal changes. I just added functions for reading an integer, string, flags, or other definition value straight into a
Variable. Eventually the parser should be refactored into a more modular system, where everything is not done in a single gigantic function. Of course, ScriptedInfo provides a new parser already, meaning the old one doesn’t necessarily have to be updated to all.
One question that does need solving is how to ensure that only valid keys are used in the definitions — Info places no restrictions on what kind of keys are added into the definitions. Invalid keys still need to reported as warnings or errors.