source: ps/trunk/binaries/data/mods/public/simulation/templates/units/pers/kardakes_hoplite.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: 485 bytes
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<Entity parent="hoplite|template_unit_champion_infantry_spearman">
3 <Identity>
4 <Civ>pers</Civ>
5 <VisibleClasses datatype="tokens">Mercenary</VisibleClasses>
6 <Lang>persian</Lang>
7 <GenericName>Cardaces Hoplite</GenericName>
8 <SpecificName>Hoplites Kardakes</SpecificName>
9 <Icon>units/pers_kardakes.png</Icon>
10 </Identity>
11 <VisualActor>
12 <Actor>units/persians/infantry_spearman_c3.xml</Actor>
13 </VisualActor>
14</Entity>
Note: See TracBrowser for help on using the repository browser.