Source File
types.go
Belonging Package
github.com/mlange-42/ark/ecs
package ecsimport// ID is the component identifier.// It is not relevant when using the default generic API.type ID struct {id uint8}// id creates a component ID from an int value. For testing.func id( int) ID {return ID{uint8()}}// id creates a component ID from an uint8 value. For testing.func id8( uint8) ID {return ID{}}// Index returns the internal component index of this component ID.func ( ID) () uint8 {return .id}// IDs is an immutable list of [ID] values.type IDs struct {data []ID}// newIDs returns a new immutable list of [ID] values.func newIDs( []ID) IDs {return IDs{data: ,}}// Get returns the ID at the given index.func ( *IDs) ( int) ID {return .data[]}// Len returns the number of IDs.func ( *IDs) () int {return len(.data)}// ResID is the resource identifier.// It is not relevant when using the default generic API.type ResID struct {id uint8}// Index returns the internal component index of this resource ID.func ( ResID) () uint8 {return .id}// Batch is like a filter for batch processing of entities.// Create it using [Filter2.Batch] etc.//// ⚠️ This should not be stored, but used immediately and re-generated// each time a batch operation is called.// Otherwise, changes to the origin filter or calls to [Filter2.Batch]// with different relationship targets may modify stored instances.type Batch struct {filter *filterrelations []relationID}// EntityDump is a dump of the entire entity data of the world.//// See [Unsafe.DumpEntities] and [Unsafe.LoadEntities].type EntityDump struct {Entities []Entity // Entities in the World's entity pool.Alive []uint32 // IDs of all alive entities in query iteration order.Next uint32 // The next free entity of the World's entity pool.Available uint32 // The number of allocated and available entities in the World's entity pool.}// CompInfo provides information about a registered component.// Returned by [ComponentInfo].type CompInfo struct {Type reflect.TypeID IDIsRelation bool}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |