Component

A component entity. You cannot instantiate this class.

new Component()

Methods

getAttributesAsHash() → {Array}

Get the attributes as a hash table where the attribute name is the hash key. This offers the best performance when doing random attribute lookups.

Returns:
Array Returns a hash of attributeName, attributeValue pairs.

getAttributesInOriginalOrder() → {Array}

Get the attributes in their original order without sorting.

Returns:
Array Returns an array of objects in the form of: { name: attributeName, objectValue: attributeValue }

getAttributesInSmartSortedOrder() → {Array}

Get the attributes in a sorted array. The attributes are sorted alphabetically by name but if 2 or more attribute names are the same and end in a number, the numbers are sorted numerically rather than alphabetically.

Returns:
Array Returns a sorted array of objects in the form of: { name: attributeName, objectValue: attributeValue }

getInstances() → {Array.<Entity>}

Get the instances of the component.

Returns:
Array.<Entity> The instances of the component.