This adds a new special attribute to CParamNode: parent. It works like you'd expect (i.e. like our current Parent): it loads the original template, and applies the current children on that.
It's a lighter version of what I wanted to do in D2915.
The existing parent system is adapted to use this. This can be used to do file inclusions.
Pros:
- will make it easier to maintain some things by reducing duplication.
Cons:
- may ultimately make loading slightly slower (unlikely to matter a _lot_ to be honest).
TODO:
- Ideally it would be good to be able to apply any CParamNode to any CParamNode, making it possible to remove the mercenary techs and stuff like that by doing 'mercenary|template_unit_infantry'.
- Detect infinite loops again.
Future work:
- More generally, CTemplateLoader should be renamed to CParamNodeManager, & CParamNode moved to ps/.
- It'd probably be good to be able to load other files into CParamNode, which is currently restricted to XML. A "RawParamNode" datafile, similar to Atla's AtObj would probably be useful.