system

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type System

type System interface {
	Name() string

	// Component is the type of the component that this system is responsible for.
	Component() string

	// Match is a check to see if the system should be run for the given key and value.
	Match(key string, value interface{}) bool

	// ComponentAdded is called when any component is added to an entity, including those the system is interested in.
	ComponentAdded(entityId string, component string, value interface{}) error

	// ComponentUpdated is called when a component is updated on an entity, including those the system is interested in.
	ComponentUpdated(entityId string, component string, oldValue interface{}, newValue interface{}) error

	// ComponentRemoved is called when a component is removed from an entity, including those the system is interested
	// in.
	ComponentRemoved(entityId string, component string) error

	// MatchingComponentAdded is called when a component is added to an entity, but only if the system is interested
	// in the component.
	MatchingComponentAdded(entityId string, value interface{}) error

	// MatchingComponentUpdated is called when a component is updated on an entity, but only if the system is interested
	// in the component.
	MatchingComponentUpdated(entityId string, oldValue interface{}, newValue interface{}) error

	// MatchingComponentRemoved is called when a component is removed from an entity, but only if the system is
	// interested in the component.
	MatchingComponentRemoved(entityId string) error
}

Jump to

Keyboard shortcuts

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