This allows including bits of XML files into other XML files. The goal is to make our templates easier to modify, particularly simulation templates.
Design goals:
- [x] Allow direct inclusion of XML nodes
- [ - [x] Allow direct inclusion of multiple XML nodes from one <include>
- [ ] Allow "modifying" includes, similar to paramnode includes (//might// be useful)
All of the above should come at no/limited performance reduction.
Current flaws:
- [ ] Not recursive.- Breaks XMB caching. This is relatively to fix, This is somewhat simple to implementbut it has performance considerations
- [ ]- Breaks XMB caching. This ishot-loading (somewhat relatively to fix, but it has performance considerationsed to the previous point).
- [ ] Breaks hot-loading (somewhat related to the previous point).- ParamNode-like modulation is very imperfect
- [ ] Cannot "modulate"- No way to pass parameters to the inclusionparented function, à-la ParamNodewhich would enable next-level stuff but also brings us close to a templating engine.
----
Examples of things I want to clean up:
- On the simulation templates side:
- For civs with custom buildings, those are added manually to every builder template. It'd be nice to have a way to include a file.
- Champion/Hero/Regular templates reuse a lot of similar template code, but aren't so modular because of the "Parent" logic.
- On the actor template side:
- We already can include variants, using rather custom code, which this would potentially make redundant / improve upon.
----
Attached is an example of XML inclusion.
----
I had a previous go at this using XInclude at D62, which ended up unsuccessfully. I didn't really fix the issues I'm listing above, and xInclude is... not great.