source: ps/trunk/binaries/data/mods/public/simulation/templates/units/athen/champion_infantry.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: 416 bytes
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<Entity parent="hoplite|template_unit_champion_infantry_spearman">
3 <Identity>
4 <Civ>athen</Civ>
5 <Lang>greek</Lang>
6 <GenericName>City Guard</GenericName>
7 <SpecificName>Epílektos</SpecificName>
8 <Icon>units/athen_champion_infantry.png</Icon>
9 </Identity>
10 <VisualActor>
11 <Actor>units/athenians/infantry_spearman_c.xml</Actor>
12 </VisualActor>
13</Entity>
Note: See TracBrowser for help on using the repository browser.