Interface: IEntity
IEntity defines how an entity should behave, and it's underlying core requirements - an ID, tags, and layers.
Implemented by
Table of contents
Properties
Properties
Add
• Add: (component
: Component) => void
Add adds a component to the entity.
param
The component to add
Type declaration:
▸ (component
: Component): void
Parameters:
Name | Type |
---|---|
component |
Component |
Returns: void
Destroy
• Destroy: () => void
Destroy deletes the entity and all associated components.
Type declaration:
▸ (): void
Returns: void
Remove
• Remove: (key
: string) => void
Remove removes a component from the entity.
param
The component to remove
Type declaration:
▸ (key
: string): void
Parameters:
Name | Type |
---|---|
key |
string |
Returns: void
id
• id: number
Unique numeric identifier of the entity.
layers
• layers: string[]
A list of layers the entity belongs to, used for grouping entities.
tags
• tags: string[]
A list of tags the entity has, used for discriminating between entities without having to add custom components.