source: ps/trunk/binaries/data/mods/public/simulation/templates/units/ptol/infantry_spearman_merc_b.xml@ 25223

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: 848 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/ptol/lighthouse
6 structures/ptol/library
7 </Entities>
8 </Builder>
9 <Identity>
10 <Civ>ptol</Civ>
11 <SelectionGroupName>units/ptol/infantry_spearman_merc_b</SelectionGroupName>
12 <GenericName>Mercenary Thureos Spearman</GenericName>
13 <SpecificName>Thureophóros Misthophóros</SpecificName>
14 <VisibleClasses datatype="tokens">Mercenary</VisibleClasses>
15 <Icon>units/ptol_infantry_spearman_2.png</Icon>
16 <RequiredTechnology>phase_town</RequiredTechnology>
17 </Identity>
18 <Promotion>
19 <Entity>units/ptol/infantry_spearman_merc_a</Entity>
20 </Promotion>
21 <VisualActor>
22 <Actor>units/ptolemies/infantry_spearman_b.xml</Actor>
23 </VisualActor>
24</Entity>
Note: See TracBrowser for help on using the repository browser.