Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Struct · Ara

Entity

A generation-checked handle to an entity in the ECS world: the engine's Entity::to_bits (a complemented index in the low 32 bits, the generation in the high 32). A despawned entity's handle never becomes valid again, so a stale handle reads as missing instead of aliasing a new entity. Use IsAlive or Has; there is no overloaded null equality.

public readonly struct Entity : IEquatable<Entity>

default(Entity) is Null: all-zero bits are never a valid entity.

Constructors

Entity

public Entity(ulong bits);

Wraps raw engine bits.

Properties

Null

public static Entity Null { get; }

The null handle (default(Entity)).

Index

public uint Index { get; }

Index part (reused after despawn, with a new generation). The engine stores it complemented.

Generation

public uint Generation { get; }

Generation part.

IsNull

public bool IsNull { get; }

True for Null.

IsAlive

public bool IsAlive { get; }

True if the entity exists in the world right now (behaviours and commands only).

Fields

Bits

public readonly ulong Bits;

The raw 64-bit handle, identical to the engine's.

Methods

Equals

public bool Equals(Entity other);

No description yet.

public override bool Equals(object obj);

No description yet.

GetHashCode

public override int GetHashCode();

No description yet.

ToString

public override string ToString();

The engine's text form: 12v1 (index, then generation).