Documentation ¶
Index ¶
- Constants
- func AddComp(e *Entity, c Comp)
- func GetAllCompOfType[T Comp](e *Entity) (out []T)
- func GetComp[T Comp](e *Entity) (out T)
- func GetFlags(id uint64) byte
- func GetGeneration(id uint64) byte
- func GetIndex(id uint64) uint64
- func NewEntityId(generation, flags byte, index uint64) uint64
- type Comp
- type Entity
- type EntityFlag
- type Registry
Constants ¶
View Source
const ( GenerationShiftBits = 64 - 8 FlagsShiftBits = 64 - 16 IndexBitMask = 0x00_00_FFFF_FFFF_FFFF )
Variables ¶
This section is empty.
Functions ¶
func GetAllCompOfType ¶
func GetGeneration ¶
func NewEntityId ¶
Types ¶
type Entity ¶
type Entity struct { // Byte 1: Generation; Byte 2: Flags; Bytes 3-8: Index ID uint64 Comps []Comp }
func (*Entity) HasFlag ¶
func (e *Entity) HasFlag(ef EntityFlag) bool
type EntityFlag ¶
type EntityFlag byte
const ( EntityFlag_Unknown EntityFlag = 0 EntityFlag_Dead EntityFlag = 1 << (iota - 1) EntityFlag_Alive )
Click to show internal directories.
Click to hide internal directories.