KernelAPI reference
Struct Handle<T\>
Namespace: MicroEngine.Kernel
Assembly: MicroEngine.Kernel.dll
Guide: Modules and the frame schedule
A reference to an item of a HandlePool`1: a slot index and the generation of the item that held the
slot when the handle was made. When the item is removed its slot’s generation changes, so an old handle no longer
finds anything (instead of finding whatever reuses the slot). default is None.
public readonly struct Handle<T> : IEquatable<Handle<T>>Type Parameters
T
The kind of item, so handles of different pools cannot be mixed up.
Implements
Constructors
Handle(int, uint)
A reference to an item of a HandlePool`1: a slot index and the generation of the item that held the
slot when the handle was made. When the item is removed its slot’s generation changes, so an old handle no longer
finds anything (instead of finding whatever reuses the slot). default is None.
public Handle(int Index, uint Generation)Parameters
Index int
The slot.
Generation uint
The generation of the slot’s item; 0 only for None.
Properties
Generation
The generation of the slot’s item; 0 only for None.
public uint Generation { get; init; }Property Value
Index
The slot.
public int Index { get; init; }Property Value
IsNone
Whether this is None.
public bool IsNone { get; }Property Value
None
The handle of nothing.
public static Handle<T> None { get; }Property Value
Handle<T>
Methods
Deconstruct(out int, out uint)
public void Deconstruct(out int Index, out uint Generation)Parameters
Index int
Generation uint
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(Handle<T>)
public bool Equals(Handle<T> other)Parameters
other Handle<T>
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(Handle<T>, Handle<T>)
public static bool operator ==(Handle<T> left, Handle<T> right)Parameters
left Handle<T>
right Handle<T>
Returns
operator !=(Handle<T>, Handle<T>)
public static bool operator !=(Handle<T> left, Handle<T> right)Parameters
left Handle<T>
right Handle<T>