Entity
Summary
A generic Entity container. An entity is what runs all of EBX logic, and is interactable with this API.
Properties
| Name | Type |
|---|---|
| data | DataContainer |
| bus | EntityBus |
Methods
| Method | Returns |
|---|---|
| Event(event: EntityEvent) | void |
| FireEvent(event: EntityEvent) | void |
| Write(fieldName: string, typeName: string, value: any) | void |
| Read(fieldName: string, typeName: string) | any |
Properties
data
The entity's exposed data.
bus
The entity's bus.
Methods
Event
Entity:Event(event: EntityEvent): voidQueue an event to be executed into the context it is in.
Parameters
| Name | Type | Description |
|---|---|---|
| event | EntityEvent | The event you want to execute. |
FireEvent
Entity:FireEvent(event: EntityEvent): voidImmediately fire an event to be processed internally in the entity.
Parameters
| Name | Type | Description |
|---|---|---|
| event | EntityEvent | The event you want to execute. |
Write
Entity:Write(fieldName: string, typeName: string, value: any): voidExecute a property write on the entity. These are the IN properties.
Parameters
| Name | Type | Description |
|---|---|---|
| fieldName | string | The field name. Can either be a string or the field hash (like 0x236BA71D) |
| typeName | string | The name of the type being written. |
| value | any | The value being written. |
Read
Entity:Read(fieldName: string, typeName: string): anyRead a property from the entity. These are the OUT properties.
Parameters
| Name | Type | Description |
|---|---|---|
| fieldName | string | The field name. Can either be a string or the field hash (like 0x236BA71D) |
| typeName | string | The name of the type you want read. |
Returns
| Type | Description |
|---|---|
| any |