Entity

Summary

A generic Entity container. An entity is what runs all of EBX logic, and is interactable with this API.

Properties

Methods

MethodReturns
Event(event: EntityEvent)void
FireEvent(event: EntityEvent)void
Write(fieldName: string, typeName: string, value: any)void
Read(fieldName: string, typeName: string)any

Properties


data

DataContainer

The entity's exposed data.


bus

EntityBus

The entity's bus.


Methods

Event

Entity:Event(event: EntityEvent): void

Queue an event to be executed into the context it is in.

Parameters

NameTypeDescription
eventEntityEventThe event you want to execute.

FireEvent

Entity:FireEvent(event: EntityEvent): void

Immediately fire an event to be processed internally in the entity.

Parameters

NameTypeDescription
eventEntityEventThe event you want to execute.

Write

Entity:Write(fieldName: string, typeName: string, value: any): void

Execute a property write on the entity. These are the IN properties.

Parameters

NameTypeDescription
fieldNamestringThe field name. Can either be a string or the field hash (like 0x236BA71D)
typeNamestringThe name of the type being written.
valueanyThe value being written.

Read

Entity:Read(fieldName: string, typeName: string): any

Read a property from the entity. These are the OUT properties.

Parameters

NameTypeDescription
fieldNamestringThe field name. Can either be a string or the field hash (like 0x236BA71D)
typeNamestringThe name of the type you want read.

Returns

TypeDescription
any