Nebula
|
Represents a game object that resides in a game world.
Contains properties and native components that make up the behaviour and logic of the entity. Entities can receive messages which are propagated to all properties that listen for the message.
Public Member Functions | |
bool | IsValid () |
Check if entity is valid (not destroyed) | |
bool | HasComponent< T > () |
Check if entity has some unmanaged component. | |
void | SetComponent< T > (in T component) |
Set the value of a native, unmanaged component. | |
T | GetComponent< T > () |
Gets a value copy of the native, unmanaged component. | |
bool | HasProperty< T > () |
Checks if the entity has a certain property. | |
void | AddProperty (Property property) |
Adds a property to the entity. | |
T | GetProperty< T > () |
Gets the property if it exists in the entity. | |
Vector3 | GetPosition () |
Gets the position of the entity. | |
void | SetPosition (Vector3 position) |
Sets the position of the entity. | |
Quaternion | GetOrientation () |
Gets the orientation of the entity. | |
void | SetOrientation (Quaternion orientation) |
Sets the orientation of the entity. | |
Vector3 | GetScale () |
Gets the scale of the entity. | |
void | SetScale (Vector3 scale) |
Sets the scale of the entity. | |
void | Send< T > (in T msg) |
Sends this entity a message. | |
override string | ToString () |
Constructs a string representation of this entity. | |
Static Public Member Functions | |
static void | Destroy (Entity entity) |
Schedule the entity for destruction. | |
Package Functions | |
Entity (World world, UInt64 entityId) | |
Properties | |
World | World [get] |
The world that this entity belongs to. | |
UInt64 | Id [get] |
Unique identifier for the entity. | |
Private Attributes | |
World | world = null |
UInt64 | id = 0xFFFFFFFFFFFFFFFF |
List< Property > | properties |
MsgDispatcher | dispatcher = new MsgDispatcher() |
|
inlinepackage |
Do not create new entities using this constructor, instead create them via World.CreateEntity.
|
inline |
Adds a property to the entity.
|
inlinestatic |
Schedule the entity for destruction.
Note that this does not immediately remove the entity from the native backend.
|
inline |
Gets a value copy of the native, unmanaged component.
This method does allocate and copy memory, thus should be used sparringly in time-critical code.
T | : | struct | |
T | : | NativeComponent |
|
inline |
Gets the orientation of the entity.
|
inline |
Gets the position of the entity.
|
inline |
Gets the property if it exists in the entity.
This is a linear search (O(N)) through all properties attached to this entity.
T | : | Property |
|
inline |
Gets the scale of the entity.
|
inline |
Check if entity has some unmanaged component.
T | : | struct | |
T | : | NativeComponent |
|
inline |
Checks if the entity has a certain property.
This is a linear search (O(N)) through all properties attached to this entity.
T | : | Property |
|
inline |
Check if entity is valid (not destroyed)
|
inline |
Sends this entity a message.
The message will be propagated into all Properties that this entity has, that accepts the message.
T | : | struct | |
T | : | Msg |
|
inline |
Set the value of a native, unmanaged component.
This method does allocate and copy memory, thus should be used sparringly in time-critical code.
T | : | struct | |
T | : | NativeComponent |
|
inline |
Sets the orientation of the entity.
|
inline |
Sets the position of the entity.
|
inline |
Sets the scale of the entity.
|
inline |
Constructs a string representation of this entity.
|
private |
|
private |
|
private |
|
private |
|
get |
Unique identifier for the entity.
|
get |
The world that this entity belongs to.