Documentation
¶
Index ¶
- func CreateComponentMatcher(components []types.Component) func(types.Component) bool
- func MatchComponentMetadata(components []types.ComponentMetadata, cType types.ComponentMetadata) bool
- type ComponentFilter
- func All() ComponentFilter
- func And(filters ...ComponentFilter) ComponentFilter
- func Contains(components ...ComponentWrapper) ComponentFilter
- func Exact(components ...ComponentWrapper) ComponentFilter
- func Not(filter ComponentFilter) ComponentFilter
- func Or(filters ...ComponentFilter) ComponentFilter
- type ComponentWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComponentMatcher ¶
CreateComponentMatcher creates a function given a slice of components. This function will take a parameter that is a single component and return true if it is in the slice of components or false otherwise
func MatchComponentMetadata ¶
func MatchComponentMetadata( components []types.ComponentMetadata, cType types.ComponentMetadata, ) bool
MatchComponentMetadata returns true if the given slice of components contains the given component. Components are the same if they have the same Name.
Types ¶
type ComponentFilter ¶
type ComponentFilter interface { // MatchesComponents returns true if the entity matches the filter. MatchesComponents(components []types.Component) bool }
ComponentFilter is a filter that filters entities based on their components.
func All ¶
func All() ComponentFilter
func And ¶
func And(filters ...ComponentFilter) ComponentFilter
func Contains ¶
func Contains(components ...ComponentWrapper) ComponentFilter
Contains matches archetypes that contain all the components specified.
func Exact ¶
func Exact(components ...ComponentWrapper) ComponentFilter
Exact matches archetypes that contain exactly the same components specified.
func Not ¶
func Not(filter ComponentFilter) ComponentFilter
func Or ¶
func Or(filters ...ComponentFilter) ComponentFilter
type ComponentWrapper ¶ added in v1.3.0
func Component ¶ added in v1.3.0
func Component[T types.Component]() ComponentWrapper
Component is public but contains an unexported return type this is done with intent as the user should never use ComponentWrapper explicitly.
func ConvertComponentMetadatasToComponentWrappers ¶ added in v1.3.0
func ConvertComponentMetadatasToComponentWrappers(comps []types.ComponentMetadata) []ComponentWrapper