Quantum 2 2.1.9

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.EntityRef Struct Reference

Quantum entity reference. More...

Inherits IEquatable< EntityRef >.

Public Member Functions

string GetName (FrameBase frame)
 Converts entity to a name, used throughout the editor. Can be overriden with GetEntityNameUser delegate. More...
 

Public Attributes

int Index
 Entity index. More...
 
bool IsValid => Raw != 0
 Returns false if this entity is equal to EntityRef.None More...
 
int Version
 Entity version is incremented during the entity life cycle when the entity slot is reused. More...
 

Properties

static EntityRefGetNameUserDelegate GetEntityNameUser [get, set]
 A delegate invoked in GetName. If there is no frame available, the frame delegate parameter will be passed as null. If the delegate is null or returns null, the result of ToString will be returned. More...
 
static EntityRef None [get]
 The EntityRef value defining a non-existent Entity. More...
 

Detailed Description

Quantum entity reference.

Quantum implements a sparse-set ECS model (similar to enTT). This means entities are just references to collections of components.

Most important advantages: memory consumption is proportional to instantiated entities + ability to add and remove components dynamically.

Member Function Documentation

◆ GetName()

string Quantum.EntityRef.GetName ( FrameBase  frame)
inline

Converts entity to a name, used throughout the editor. Can be overriden with GetEntityNameUser delegate.

Member Data Documentation

◆ IsValid

bool Quantum.EntityRef.IsValid => Raw != 0

Returns false if this entity is equal to EntityRef.None

◆ Index

int Quantum.EntityRef.Index

Entity index.

◆ Version

int Quantum.EntityRef.Version

Entity version is incremented during the entity life cycle when the entity slot is reused.

Property Documentation

◆ None

EntityRef Quantum.EntityRef.None
staticget

The EntityRef value defining a non-existent Entity.

◆ GetEntityNameUser

EntityRefGetNameUserDelegate Quantum.EntityRef.GetEntityNameUser
staticgetset

A delegate invoked in GetName. If there is no frame available, the frame delegate parameter will be passed as null. If the delegate is null or returns null, the result of ToString will be returned.