Quantum entity reference identifies a unique Entity. More...
Inherits IEquatable< EntityRef >.
Public Member Functions | |
bool | Equals (EntityRef other) |
Returns a value indicating whether this instance is equal to a specified EntityRef value. More... | |
override bool | Equals (object obj) |
Determines whether two object instances are equal. More... | |
override int | GetHashCode () |
Overrides the default hash function. More... | |
override string | ToString () |
Converts the numeric value of this instance to its equivalent string representation. More... | |
Static Public Member Functions | |
static bool | operator!= (EntityRef a, EntityRef b) |
Operator override for which checks if two instances of EntityRef are not equal. More... | |
static bool | operator== (EntityRef a, EntityRef b) |
Operator override for which checks if two instances of EntityRef are equal. More... | |
static void | Print (void *ptr, FramePrinter printer) |
Prints the REPLACE using a FramePrinter. More... | |
static void | Serialize (void *ptr, FrameSerializer stream) |
Serializes a EntityRef into a FrameSerializer to write or read from a frame snapshot. More... | |
static bool | TryParse (string str, out EntityRef result) |
Try to parse an EntityRef from a string. 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... | |
Static Public Attributes | |
const int | SIZE = sizeof(int) + sizeof(int) |
The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More... | |
Properties | |
static IEqualityComparer< EntityRef > | Comparer [get] |
Global Entity ref comparer. More... | |
static EntityRef | None [get] |
The EntityRef value defining a non-existent Entity. More... | |
Quantum entity reference identifies a unique Entity.
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.
Operator override for which checks if two instances of EntityRef are equal.
true
if the instances are equal.Operator override for which checks if two instances of EntityRef are not equal.
true
if the instances are not equal.
|
inline |
Returns a value indicating whether this instance is equal to a specified EntityRef value.
other | An EntityRef value to compare to this instance. |
true
if other has the same value as this instance; otherwise, false
.
|
inline |
Determines whether two object instances are equal.
obj | The object to compare with the current object. |
true
if the specified object is equal to the current object; otherwise, false
.
|
inline |
Overrides the default hash function.
|
inlinestatic |
|
inlinestatic |
Prints the REPLACE using a FramePrinter.
ptr | Pointer to REPLACE instance |
printer | Printer object |
|
inline |
Converts the numeric value of this instance to its equivalent string representation.
|
inlinestatic |
Try to parse an EntityRef from a string.
str | String |
result | Resulting EntityRef |
true
if the entity ref was successfully parsed
|
static |
The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.
bool Quantum.EntityRef.IsValid => Raw != 0 |
Returns false
if this entity is equal to EntityRef.None
int Quantum.EntityRef.Index |
Entity index.
int Quantum.EntityRef.Version |
Entity version is incremented during the entity life cycle when the entity slot is reused.
|
staticget |
Global Entity ref comparer.
|
staticget |
The EntityRef value defining a non-existent Entity.