Package-level declarations

Types

Link copied to clipboard
expect class BitSet

Cross-platform interface for a bitset.

actual class BitSet
actual class BitSet
Link copied to clipboard
typealias Component = Any

GearyComponents aren't an interface because we like the option to be able to add Any class as a component to an entity. However, for clarity we create this typealias.

Since Any is not inherently serializable like an interface, when expecting a Component to be serializable, use the Polymorphic annotation.

Link copied to clipboard
typealias ComponentId = EntityId

Type alias for component IDs. Is the same as EntityId.

Link copied to clipboard
@Serializable
value class Entity(val id: EntityId)

A wrapper around EntityId that gets inlined to just a long (no performance degradation since no boxing occurs).

Link copied to clipboard
typealias EntityId = ULong

Type alias for entity IDs.

Link copied to clipboard
class EntityStack(stack: DoubleQueue = DoubleQueue())
Link copied to clipboard
value class EntityType

An inlined class used for tracking the components an entity/archetype has.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias GearyEntity = Entity
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias GearyRecord = Record
Link copied to clipboard
Link copied to clipboard
typealias IdList = ArrayList<Long>
Link copied to clipboard
class Record : SynchronizedObject
Link copied to clipboard
@Serializable
value class Relation : Comparable<Relation>

A combination of a data kind and target entity that represents a relation between two entities.

Functions

Link copied to clipboard
fun bitsOf(): BitSet
Link copied to clipboard
inline fun Long.forEachBit(run: (Int) -> Unit)
Link copied to clipboard
inline fun Relation.hasRole(role: ULong): Boolean
inline fun ComponentId.hasRole(role: ULong): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Long.pop1(): Long
Link copied to clipboard
fun Long.setBit(index: Int): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Long.unsetBit(index: Int): Long
Link copied to clipboard
Link copied to clipboard
inline fun Relation.withoutRole(role: ULong): Relation
inline fun ComponentId.withoutRole(role: ULong): ULong
Link copied to clipboard
inline fun Relation.withRole(role: ULong): Relation
inline fun ComponentId.withRole(role: ULong): ULong

Properties

Link copied to clipboard
const val ENTITY_MASK: ULong
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard