ecs/entity
generationally-versioned opaque Entity handle.
Since: E0
Entity
(Entity)
opaque generational handle (packed index + generation).
Since: E0
Slot
(Slot)
a raw storage slot index, distinct from a packed `Entity`.
Since: RE0
Generation
(Generation)
a per-slot version counter, distinct from a slot index.
Since: RE0
slot->int
(slot->int [s : Slot] :)
recover the raw machine integer behind a `Slot`.
| s | the slot index |
The underlying `:int` slot index -- for printing or indexing an int-keyed storage that has not been lifted to `Slot`.
(slot->int (entity-index e)) ; => 0
Since: RE0
generation->int
(generation->int [g : Generation] :)
recover the raw machine integer behind a `Generation`.
| g | the generation counter |
The underlying `:int` generation value -- for printing or comparison against a raw counter.
(generation->int (entity-generation e)) ; => 1
Since: RE0
slot-new
(slot-new [i : int] :)
tag a raw machine integer as a `Slot`.
| i | the raw slot index |
The `Slot` newtype wrapping i.
(slot-new 3) ; => Slot 3
Since: RE0
generation-new
(generation-new [g : int] :)
tag a raw machine integer as a `Generation`.
| g | the raw generation counter |
The `Generation` newtype wrapping g.
(generation-new 0) ; => Generation 0
Since: RE0
entity-new
(entity-new [idx : Slot gen : Generation] :)
pack (index, generation) into an Entity.
| idx | entity slot index | |
| gen | generation counter |
Packed Entity handle.
(entity-new (slot-new 3) (generation-new 0))
Since: E0
entity-index
(entity-index [e : Entity] :)
unpack the slot index.
| e | the packed entity handle |
The `Slot` this entity names.
(entity-index e) ; => Slot
Since: E0
entity-generation
(entity-generation [e : Entity] :)
unpack the generation counter.
| e | the packed entity handle |
The `Generation` this entity carries.
Since: E0
Internal definitions
entity-- structural equality on Entity handles.