Skip to content

KernelAPI reference

Struct EntityId

Namespace: MicroEngine.Scenes
Assembly: MicroEngine.Scene.dll
Guide: Scenes

An entity of an IWorld: a slot index and the generation of the entity that held the slot when the id was made. A destroyed entity’s slot is reused with a new generation, so an old id never reaches the new entity. default is None (generation 0 is never issued).

C#
public readonly struct EntityId : IEquatable<EntityId>

Implements

IEquatable<EntityId>

Constructors

EntityId(uint, uint)

An entity of an IWorld: a slot index and the generation of the entity that held the slot when the id was made. A destroyed entity’s slot is reused with a new generation, so an old id never reaches the new entity. default is None (generation 0 is never issued).

C#
public EntityId(uint Index, uint Generation)

Parameters

Index uint

The slot.

Generation uint

The generation of the slot’s entity; 0 only for None.

Properties

Generation

The generation of the slot’s entity; 0 only for None.

C#
public uint Generation { get; init; }

Property Value

uint

Index

The slot.

C#
public uint Index { get; init; }

Property Value

uint

IsNone

Whether this is None.

C#
public bool IsNone { get; }

Property Value

bool

None

The id of no entity.

C#
public static EntityId None { get; }

Property Value

EntityId

Methods

Deconstruct(out uint, out uint)

C#
public void Deconstruct(out uint Index, out uint Generation)

Parameters

Index uint

Generation uint

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(EntityId)

C#
public bool Equals(EntityId other)

Parameters

other EntityId

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(EntityId, EntityId)

C#
public static bool operator ==(EntityId left, EntityId right)

Parameters

left EntityId

right EntityId

Returns

bool

operator !=(EntityId, EntityId)

C#
public static bool operator !=(EntityId left, EntityId right)

Parameters

left EntityId

right EntityId

Returns

bool