Documentation ¶
Overview ¶
Package entitysys provides a simple entity component system for handling entities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container stores multiple systems and their entities.
func (*Container) AddEntity ¶
func (c *Container) AddEntity(entity interface{})
AddEntity adds the entity to all systems that are compatible with the entity.
func (*Container) AddSystem ¶
AddSystem adds the system to the container, the passed desc values will be used to match when an entity is added. f will called for all matching entities depending on the stage. All parameters to f are automatically added to matchers.
func (*Container) RemoveEntity ¶
func (c *Container) RemoveEntity(e interface{})
RemoveEntity removes the entity from all systems it is attached too.
type Matcher ¶
type Matcher interface {
Match(e interface{}) bool
}
Matcher is used to select when an entity is used for a system.
Click to show internal directories.
Click to hide internal directories.