Documentation
¶
Index ¶
- func AddComponents(r *Registry, eID EntityID, components ...Component) error
- func Destroy(r *Registry, eID EntityID) error
- func Process(r *Registry, dt time.Duration)
- func RegisterSystems(r *Registry, systems ...System)
- func RemoveComponents(r *Registry, eID EntityID, cIDs ...ComponentID) error
- func UnregisterSystems(r *Registry, sIDs ...SystemID)
- type Component
- type ComponentID
- type EntityID
- type OperativeSets
- type Registry
- func (r *Registry) AddComponentsToEntity(eID EntityID, cs ...Component) error
- func (r *Registry) GetComponentsFromEntity(eID EntityID, cIDs ...ComponentID) (entityComponentMap, error)
- func (r *Registry) QueryEntities(qm SystemQueryMode, incl, excl []ComponentID) componentEntitySet
- func (r *Registry) RegisterEntity(cs ...Component) (EntityID, error)
- func (r *Registry) RemoveComponentsFromEntity(eID EntityID, cIDs ...ComponentID) (bool, error)
- func (r *Registry) UnregisterEntity(eID EntityID) error
- type RegistryConfig
- type System
- type SystemID
- type SystemQueryMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSystems ¶
func RemoveComponents ¶
func RemoveComponents(r *Registry, eID EntityID, cIDs ...ComponentID) error
func UnregisterSystems ¶
Types ¶
type Component ¶
type Component interface {
ID() ComponentID
}
type ComponentID ¶
type ComponentID uint16
type OperativeSets ¶
type OperativeSets map[EntityID]map[ComponentID]Component
type Registry ¶
func NewRegistry ¶
func NewRegistry() *Registry
func NewRegistryWithConfig ¶
func NewRegistryWithConfig(c RegistryConfig) *Registry
func (*Registry) AddComponentsToEntity ¶
func (*Registry) GetComponentsFromEntity ¶
func (r *Registry) GetComponentsFromEntity(eID EntityID, cIDs ...ComponentID) (entityComponentMap, error)
func (*Registry) QueryEntities ¶
func (r *Registry) QueryEntities(qm SystemQueryMode, incl, excl []ComponentID) componentEntitySet
func (*Registry) RegisterEntity ¶
func (*Registry) RemoveComponentsFromEntity ¶
func (r *Registry) RemoveComponentsFromEntity(eID EntityID, cIDs ...ComponentID) (bool, error)
func (*Registry) UnregisterEntity ¶
type RegistryConfig ¶
type System ¶
type System interface { ID() SystemID QueryMode() SystemQueryMode IncludeTypes() []ComponentID ExcludeTypes() []ComponentID Process(dt time.Duration, operativeSets OperativeSets) }
type SystemQueryMode ¶
type SystemQueryMode int
const ( Exclusive SystemQueryMode = iota Inclusive )
Click to show internal directories.
Click to hide internal directories.