Parse

ClubCrawler.Utility. Parse

Source:

Helper functions for map parsing

Methods

(static) getConstructorConfigFromLayerMap(item, layerMap) → {Object|boolean}

Source:

Parses a layer map recursively to find the matching Object that has the "creates" property for an item, then returns that object.

Parameters:
Name Type Description
item any
layerMap any

The layer map

Returns:

Either an object with the property 'creates' equal to the mapping and other sibling properties, or false

Type
Object | boolean

(static) getFlatTiledObjectProperties(PropertiesArray) → {Object}

Source:

Flattens custom properties of a Tiled Object into 1 object.

Converts an array of Objects to one object and returns it. Returns empty object if not possible

Parameters:
Name Type Description
PropertiesArray Array.<Object>

The Tiled Properties Array

Returns:
  • Object with top level being property name
Type
Object

(static) isConstructorConfig(object) → {Object|boolean}

Source:

Determines if an object has the property 'creates' and returns it if does. Otherwise returns false.

Parameters:
Name Type Description
object any
Returns:
Type
Object | boolean