stats

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package stats provides the structs returned by ecs.World.Stats().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archetype added in v0.11.0

type Archetype struct {
	// Whether the archetype is currently active.
	IsActive bool
	// Number of entities in the archetype.
	Size int
	// Capacity of the archetype.
	Capacity int
	// Total reserved memory for entities and components, in bytes.
	Memory int
}

Archetype provide statistics for an archetype.

type Entities added in v0.11.0

type Entities struct {
	// Currently used/alive entities.
	Used int
	// Current capacity of the entity pool.
	Total int
	// Recycled/available entities.
	Recycled int
	// Current capacity of the entities list.
	Capacity int
}

Entities provide statistics about [ecs.World] entities.

func (*Entities) String added in v0.11.0

func (s *Entities) String() string

type Node added in v0.11.0

type Node struct {
	// Total number of archetypes, incl. inactive.
	ArchetypeCount int
	// Number of active archetypes.
	ActiveArchetypeCount int
	// Whether the node is active and contains archetypes.
	IsActive bool
	// Whether the node contains relation archetypes.
	HasRelation bool
	// Number of components.
	Components int
	// Component IDs.
	ComponentIDs []uint8
	// Component types for ComponentIDs.
	ComponentTypes []reflect.Type
	// Memory for components per entity, in bytes.
	MemoryPerEntity int
	// Total reserved memory for entities and components, in bytes.
	Memory int
	// Number of entities in the archetypes of this node.
	Size int
	// Sum of capacity of the archetypes in this node.
	Capacity int
	// Archetype statistics.
	Archetypes []Archetype
}

Node provide statistics for an archetype graph node.

func (*Node) String added in v0.11.0

func (s *Node) String() string

type World added in v0.11.0

type World struct {
	// Entity statistics.
	Entities Entities
	// Total number of components.
	ComponentCount int
	// Component types, indexed by component ID.
	ComponentTypes []reflect.Type
	// Locked state of the world.
	Locked bool
	// Node statistics.
	Nodes []Node
	// Number of active nodes, i.e. nodes with actual archetype(s).
	ActiveNodeCount int
	// Memory used by entities and components.
	Memory int
	// Number of cached filters.
	CachedFilters int
}

World provide statistics for an [ecs.World].

func (*World) String added in v0.11.0

func (s *World) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL