new Entity()
Methods
-
addComponent()
-
Adds a single
Component
object to the Entity. -
addComponents(components)
-
Adds multiple
Component
objects to the Entity.Parameters:
Name Type Description components
Array An array of components to add.
-
destroy()
-
-
getComponentsByType()
-
Returns an array of all Components with a given type.
-
hasComponentType()
-
Returns whether or not the Entity has a component of a given type assigned to it.
-
removeComponent()
-
Removes a single Component from the Entity.
-
removeComponents(components)
-
Removes multiple
Component
objects from the Entity.Parameters:
Name Type Description components
Array A list of components to remove.