query

package
v1.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: CC0-1.0, MIT Imports: 4 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Query

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

Query represents a query for entities. It is used to filter entities based on their components. It receives arbitrary filters that are used to filter entities. It contains a cache that is used to avoid re-evaluating the query. So it is not recommended to create a new query every time you want to filter entities with the same query.

func NewQuery

func NewQuery(filter filter.LayoutFilter) *Query

NewQuery creates a new query. It receives arbitrary filters that are used to filter entities.

func (*Query) Count added in v0.0.6

func (q *Query) Count(w donburi.World) int

Count returns the number of entities that match the query.

func (*Query) EachEntity

func (q *Query) EachEntity(w donburi.World, callback func(*donburi.Entry))

EachEntity iterates over all entities that match the query.

func (*Query) FirstEntity

func (q *Query) FirstEntity(w donburi.World) (entry *donburi.Entry, ok bool)

FirstEntity returns the first entity that matches the query.

Jump to

Keyboard shortcuts

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