Last change
on this file since 25223 was 25223, checked in by wraitii, 3 years ago |
Allow arbitrary compositions in TemplateLoader template names.
- Allows compositing any two templates in TemplateLoader, and not just filters: 'A|B|C' is now valid for any template A, B and C.
- Allows parents to be composited paths 'A|B|C'. In such a schema, if A or B themselves specify a parent, the actual composition becomes A|pA|B|pB|C and so on.
This allows, by leveraging the common schema of our entities, to reduce duplication.
For convenience, templates in "special/filters/" and "mixins/" can be included by their direct name. Others have to be completely specified.
See the two provided cases for examples:
- 'hoplite' becomes a mixin that can be used to apply the Phalanx formation
- 'builder' becomes a mixin that can be give a template the ability to build the standard structures, and gives the 'Builder' identity class. This also allows deduplicating that list of tokens.
Update checkrefs & swap std::map for std::unordered_map in TemplateLoader.
Differential Revision: https://code.wildfiregames.com/D3801
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/xml
|
File size:
731 bytes
|
Line | |
---|
1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <Entity parent="hoplite|template_unit_infantry_melee_spearman">
|
---|
3 | <Builder>
|
---|
4 | <Entities datatype="tokens">
|
---|
5 | structures/athen/gymnasium
|
---|
6 | structures/athen/prytaneion
|
---|
7 | </Entities>
|
---|
8 | </Builder>
|
---|
9 | <Identity>
|
---|
10 | <Civ>athen</Civ>
|
---|
11 | <Lang>greek</Lang>
|
---|
12 | <SelectionGroupName>units/athen/infantry_spearman_b</SelectionGroupName>
|
---|
13 | <GenericName>Athenian Hoplite</GenericName>
|
---|
14 | <SpecificName>Hoplítēs Athēnaîos</SpecificName>
|
---|
15 | <Icon>units/athen_infantry_spearman.png</Icon>
|
---|
16 | </Identity>
|
---|
17 | <Promotion>
|
---|
18 | <Entity>units/athen/infantry_spearman_a</Entity>
|
---|
19 | </Promotion>
|
---|
20 | <VisualActor>
|
---|
21 | <Actor>units/athenians/infantry_spearman_b.xml</Actor>
|
---|
22 | </VisualActor>
|
---|
23 | </Entity>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.