Live Data Reference #
Entity Class #
An Entity data class has the following properties and functions:
| Property | Description |
|---|---|
entityName: EntityName | The name for a type of data in your player data feature. This name does not have to be unique, but it must be different compared to other Component declarations. |
instancedId: UUID | The unique ID for the instance of the Entity. |
componentContainers: MutableList<ComponentContainer> | The list of Components belonging to the specific Entity. |
getComponents() | Returns a list of Components. |
addComponent() | Fetches a Component, creates a ComponentContainer for said Component, and then adds the newly created ComponentContainer to the componentContainers collection. |
removeComponent(componentId: UUID) | Removes a Component from the componentsContainers collection by its componentId. |
removeComponent(component: Component) | Removes Component(s) from the componentsContainers collection. |
getComponentsByType<reified T: Component>() | Returns a list of Components that are an instance of the generic parameter. |
Component Container Class #
A ComponentContainer data class has the following properties:
| Property | Description |
|---|---|
componentId: UUID | The unique ID that identifies the Component and helps with data persistence. |
component: Component | Utilized by the engine layer to contain the Component. |