Help us shape the future of Go! Take the 2026 Go Developer Survey

store

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityMapKey

type EntityMapKey struct {
	// contains filtered or unexported fields
}

EntityMapKey is the tuple key for the entities map

func NewEntityMapKey

func NewEntityMapKey(ent entity.Entity) EntityMapKey

NewEntityMapKey constructs a new EntityMapKey from an Entity

type Handler

type Handler interface {
	// HandleEntityAdded handles a new entity being added to the store.
	HandleEntityAdded(ent entity.Entity)
	// HandleEntityRemoved handles a entity being removed from the store.
	HandleEntityRemoved(ent entity.Entity)
}

Handler handles store events.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store tracks, refcounts, and de-duplicates known entities.

func NewStore

func NewStore(handler Handler) *Store

NewStore constructs a new Store.

func (*Store) AddEntityObj

func (s *Store) AddEntityObj(ent entity.Entity)

AddEntityObj adds an entity object to the store.

func (*Store) RemoveEntityObj

func (s *Store) RemoveEntityObj(ent entity.Entity) bool

RemoveEntityObj removes an entity object from the store. Returns if found.

Jump to

Keyboard shortcuts

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