entitycache

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package entitycache stores large system records densely behind a small entity index.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store[T any] struct {
	// contains filtered or unexported fields
}

Store validates full entity generations. Record pointers are borrowed until the next Ensure, Delete, Reset or Trim; no pointers into ECS columns are retained.

func (*Store[T]) All

func (s *Store[T]) All(yield func(ecs.Entity, *T) bool)

All borrows densely stored values until the next mutation or Trim.

func (*Store[T]) Delete

func (s *Store[T]) Delete(entity ecs.Entity)

func (*Store[T]) Ensure

func (s *Store[T]) Ensure(entity ecs.Entity) *T

func (*Store[T]) Get

func (s *Store[T]) Get(entity ecs.Entity) *T

func (*Store[T]) Len

func (s *Store[T]) Len() int

func (*Store[T]) Prune

func (s *Store[T]) Prune(keep func(ecs.Entity, *T) bool)

Prune removes entries rejected by keep. The callback must not mutate this store.

func (*Store[T]) Reset

func (s *Store[T]) Reset()

func (*Store[T]) Trim

func (s *Store[T]) Trim()

Trim drops historical record capacity and trailing unused index slots.

Jump to

Keyboard shortcuts

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