Types
Archetype[T] = ref object name*: string
- A archetype of values that can be stored together
ArchetypeSet[T] = ref object
- A set of all known archetypes
Procs
proc archArchSymbolDef[T](archetype: Archetype[T]): NimNode
- Builds the code for defining an archetype symbol
proc archetypeFor[T](archs: ArchetypeSet[T]; components: openArray[T]): Archetype[ T]
- Returns the archetype to use for a set of components
proc calculateSize(arch: Archetype[ComponentDef]): Option[NimNode] {. ...raises: [KeyError], tags: [], forbids: [].}
- Calculates the storage size required to store the components of an archetype
proc contains[T](archetype: Archetype[T]; value: T): bool
- Whether an archetype contains all the given value
proc contains[T](archetypes: ArchetypeSet[T]; archetype: Archetype[T]): bool
proc containsAllOf[T](archetype: Archetype[T]; others: openArray[T]): bool
- Whether an archetype contains all the given values
proc containsAnyOf[T](archetype: Archetype[T]; others: openArray[T]): bool
- Whether an archetype contains any the given values
proc dumpAnalysis[T](archetypes: ArchetypeSet[T])
- Prints an analysis of the archetypes in a set
proc ident(archetype: Archetype[ComponentDef]): NimNode {....raises: [], tags: [], forbids: [].}
- Creates a variable for referencing an archetype store
proc len[T](archetypes: ArchetypeSet[T]): int
proc matches(arch: Archetype; filter: BitsFilter): bool
- Whether this archetype can fulfill the given filter
proc newArchetype[T](values: sink seq[T]; allComps: Bits; accessoryComps: Bits): Archetype[ T]
- Create an archetype from de-duplicated, sorted values whose bit sets have already been calculated
proc newArchetypeSet[T](values: openArray[Archetype[T]]; accessories: Bits): ArchetypeSet[ T]
- Creates a set of archetypes
proc readableName(arch: Archetype[ComponentDef]): string {....raises: [], tags: [], forbids: [].}
- Returns a readable name that describes an archetype
proc removeAndAdd[T](archetype: Archetype[T]; remove: Bits; add: openArray[T]): seq[ T]
Iterators
iterator items[T](archetypes: ArchetypeSet[T]): Archetype[T]
- Produces all the archetypes