Class: DamageTypesMetadata

DamageTypesMetadata()

This class provides a cache for accessing damage types metadata stored in JSON files. Note that damage types need not be defined in JSON files to be handled in-game. (this is intended to simplify modding) This class must be initialised before using, as initialising it directly in globalscripts would introduce disk I/O every time e.g. a GUI page is loaded.

Constructor

new DamageTypesMetadata()

Source:

Methods

getName()

Source:
Returns:
the name of the @param code damage type, or @code if no metadata exists in JSON files.

sort(damageTypes) → {Array.<string>}

Parameters:
Name Type Description
damageTypes Array.<string> The damageTypes to sort.
Source:
Returns:
- The damageTypes in sorted order; first the ones where metadata is provided, then the rest.
Type
Array.<string>