Members
auraData
Raw Data Caches.
AuraPath
Paths to certain files.
It might be nice if we could get these from somewhere, instead of having them hardcoded here.
AuraTranslateKeys
Keys of template values that are to be translated on load.
autoResearchTechList
Partly-composed data.
Methods
buildPlayerTemplateName()
If a civ doesn't have its own civ-specific player template,
this returns the name of the generic player template.
- Source:
- See:
-
- simulation/helpers/Player.js GetPlayerTemplateName() (Which can't be combined with this due to different Engine contexts)
findAllAutoResearchedTechs() → {array}
Crudely iterates through every tech JSON file and identifies those
that are auto-researched.
Returns:
List of techs that are researched automatically
- Type
- array
getVariantBaseAndType()
A template may be a variant of another template,
eg. `*_house`, `*_trireme`, or a promotion.
This method returns an array containing:
[0] - The template's basename
[1] - The variant type
[2] - Further information (if available)
e.g.:
units/athen/infantry_swordsman_e
-> ["units/athen/infantry_swordsman_b", TemplateVariant.promotion, "elite"]
units/brit/support_female_citizen_house
-> ["units/brit/support_female_citizen", TemplateVariant.unlockedByTechnology, "unlock_female_house"]
loadAuraTemplate(templateName) → {Object}
Loads raw aura template.
Loads from local cache if available, else from file system.
Parameters:
Name | Type | Description |
---|---|---|
templateName |
string |
Returns:
Object containing raw template data.
- Type
- Object
loadEntityTemplate(templateName, civCode) → {Object}
Loads raw entity template.
Loads from local cache if data present, else from file system.
Parameters:
Name | Type | Description |
---|---|---|
templateName |
string | |
civCode |
string |
Returns:
Object containing raw template data.
- Type
- Object
loadPlayerTemplate(civCode) → {Object}
Loads raw player template.
Loads from local cache if data present, else from file system.
If a civ doesn't have their own civ-specific template,
then we return the generic template.
Parameters:
Name | Type | Description |
---|---|---|
civCode |
string |
Returns:
Object containing raw template data.
- Type
- Object
loadTechnologyPairTemplate(templateName, civCode) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
templateName |
string | |
civCode |
string |
Returns:
Contains a list and the requirements of the techs in the pair
- Type
- Object
loadTechnologyTemplate(templateName) → {Object}
Loads raw technology template.
Loads from local cache if available, else from file system.
Parameters:
Name | Type | Description |
---|---|---|
templateName |
string |
Returns:
Object containing raw template data.
- Type
- Object