Source File
config.go
Belonging Package
github.com/mlange-42/ark/ecs
package ecs// config provides configuration for an ECS [World].type config struct {// Initial capacity for archetypes and the entity index.// The default value is 128.initialCapacity int// Initial capacity for archetypes with a relation component.// The default value is initialCapacity.initialCapacityRelations int}// newConfig creates a new default [World] configuration.func newConfig( ...int) config {switch len() {case 0:return config{initialCapacity: 1024,initialCapacityRelations: 128,}case 1:if [0] < 1 {panic("only positive values for the World's initialCapacity are allowed")}return config{initialCapacity: [0],initialCapacityRelations: [0],}case 2:if [0] < 1 || [1] < 1 {panic("only positive values for the World's initialCapacity are allowed")}return config{initialCapacity: [0],initialCapacityRelations: [1],}}panic("can only use a maximum of two values for the World's initialCapacity")}
![]() |
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. |