No matching definitions.

ecs/entity

src/ecs/entity.tur

generationally-versioned opaque Entity handle.

Since: E0

defopaque

Entity

(Entity)

opaque generational handle (packed index + generation).

Since: E0

defopaque

Slot

(Slot)

a raw storage slot index, distinct from a packed `Entity`.

Since: RE0

defopaque

Generation

(Generation)

a per-slot version counter, distinct from a slot index.

Since: RE0

defn

slot->int

(slot->int [s : Slot] :)

recover the raw machine integer behind a `Slot`.

sthe 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

defn

generation->int

(generation->int [g : Generation] :)

recover the raw machine integer behind a `Generation`.

gthe generation counter

The underlying `:int` generation value -- for printing or comparison against a raw counter.

(generation->int (entity-generation e))  ; => 1

Since: RE0

defn

slot-new

(slot-new [i : int] :)

tag a raw machine integer as a `Slot`.

ithe raw slot index

The `Slot` newtype wrapping i.

(slot-new 3)  ; => Slot 3

Since: RE0

defn

generation-new

(generation-new [g : int] :)

tag a raw machine integer as a `Generation`.

gthe raw generation counter

The `Generation` newtype wrapping g.

(generation-new 0)  ; => Generation 0

Since: RE0

defn

entity-new

(entity-new [idx : Slot gen : Generation] :)

pack (index, generation) into an Entity.

idxentity slot index
gengeneration counter

Packed Entity handle.

(entity-new (slot-new 3) (generation-new 0))

Since: E0

defn

entity-index

(entity-index [e : Entity] :)

unpack the slot index.

ethe packed entity handle

The `Slot` this entity names.

(entity-index e)  ; => Slot

Since: E0

defn

entity-generation

(entity-generation [e : Entity] :)

unpack the generation counter.

ethe packed entity handle

The `Generation` this entity carries.

Since: E0

Internal definitions
entity-- structural equality on Entity handles.