entities~EntityType(name)

The type of entities.

new EntityType(name)

Constructs an entity type.
Parameters:
Name Type Description
name string The name of the entity type.

Methods

getEntities() → {Array}

Returns all entities of this type.
Returns:
Array - The list of entities of this type.

getName() → {string}

Returns the name of the entity type.
Returns:
string - The name of the entity type.

getUuid() → {string}

Returns the UUID of the entity type.
Returns:
string - The uuid of the entity type.

isEntityOfType(entity) → {Boolean}

Returns true, if the given entity is of the this type.
Parameters:
Name Type Description
entity Entity The entity.
Returns:
Boolean - True, if the given entity is of the this type.

isEntityRegistered(entity) → {Boolean}

Returns true, if the entity is registered.
Parameters:
Name Type Description
entity Entity The entity.
Returns:
Boolean - True, if the given entity is already registered.

register(entity)

Registers an entity of this entity type.
Parameters:
Name Type Description
entity Entity The entity to register.

unregister(entity)

Unregisters an entity.
Parameters:
Name Type Description
entity Entity The entity to unregister.