Documentation ¶
Index ¶
- func AddComponent[T any](r *Registry, entityId EntityId, val T)
- func AddComponentToObserver[T any](o *Observer)
- func AddExcludeComponent[T any](q *Query)
- func AddOptionalReadWriteComponent[T any](q *Query)
- func AddOptionalReadonlyComponent[T any](q *Query)
- func AddReadWriteComponent[T any](q *Query)
- func AddReadonlyComponent[T any](q *Query)
- func GetComponent[T any](c *ExecutionContext, entityId EntityId) *T
- func GetComponentByAccessor[T any](acc *ArcheTypeAccessor) *T
- func GetComponentObserver[T any](ctx *ObserverContext) *T
- func HasArcheTypeComponent[T any](a *ArcheType) bool
- func HasComponent[T any](c *ExecutionContext, entityId EntityId) bool
- func RemoveComponent[T any](r *Registry, entityId EntityId)
- func RemoveComponentFromObserver[T any](o *Observer)
- func SetComponentData[T any](acc *ArcheTypeAccessor, value T) bool
- type ArcheType
- type ArcheTypeAccessor
- type EntityId
- type ExecutionContext
- type Observer
- type ObserverContext
- type ObserverFunc
- type Query
- type QueryResult
- type Registry
- func (r *Registry) AddObserver(name string, fn ObserverFunc) *Observer
- func (r *Registry) AddSystem(name string, priority int, fn SystemFn) *System
- func (r *Registry) CreateEntity() EntityId
- func (r *Registry) IsActiveEntity(entityId EntityId) bool
- func (r *Registry) RemoveEntity(entityId EntityId)
- func (r *Registry) Tick(deltaTime time.Duration, ctx context.Context) error
- type System
- type SystemFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddComponent ¶
func AddComponentToObserver ¶
func AddExcludeComponent ¶
func AddReadWriteComponent ¶
func AddReadonlyComponent ¶
func GetComponent ¶
func GetComponent[T any](c *ExecutionContext, entityId EntityId) *T
func GetComponentByAccessor ¶
func GetComponentByAccessor[T any](acc *ArcheTypeAccessor) *T
func GetComponentObserver ¶
func GetComponentObserver[T any](ctx *ObserverContext) *T
func HasArcheTypeComponent ¶
func HasComponent ¶
func HasComponent[T any](c *ExecutionContext, entityId EntityId) bool
func RemoveComponent ¶
func SetComponentData ¶
func SetComponentData[T any](acc *ArcheTypeAccessor, value T) bool
Types ¶
type ArcheType ¶
type ArcheType struct {
// contains filtered or unexported fields
}
func (*ArcheType) Foreach ¶
func (a *ArcheType) Foreach(fn func(accessor *ArcheTypeAccessor) error) error
func (*ArcheType) GetAccessor ¶
func (a *ArcheType) GetAccessor(entityId EntityId) *ArcheTypeAccessor
type ArcheTypeAccessor ¶
type ArcheTypeAccessor struct {
// contains filtered or unexported fields
}
func (*ArcheTypeAccessor) GetArcheType ¶
func (acc *ArcheTypeAccessor) GetArcheType() *ArcheType
func (*ArcheTypeAccessor) GetEntityId ¶
func (acc *ArcheTypeAccessor) GetEntityId() EntityId
type ExecutionContext ¶
type ExecutionContext struct {
// contains filtered or unexported fields
}
func (*ExecutionContext) CreateEntity ¶
func (c *ExecutionContext) CreateEntity() EntityId
func (*ExecutionContext) GetDeltaTime ¶
func (c *ExecutionContext) GetDeltaTime() time.Duration
func (*ExecutionContext) GetQueryResult ¶
func (c *ExecutionContext) GetQueryResult(idx int) *QueryResult
func (*ExecutionContext) GetQueryResultCount ¶
func (c *ExecutionContext) GetQueryResultCount() int
func (*ExecutionContext) GetResgiry ¶
func (c *ExecutionContext) GetResgiry() *Registry
type ObserverContext ¶
type ObserverContext struct {
// contains filtered or unexported fields
}
func (*ObserverContext) CreateEntity ¶
func (ctx *ObserverContext) CreateEntity() EntityId
func (*ObserverContext) GetArcheType ¶
func (ctx *ObserverContext) GetArcheType() *ArcheType
func (*ObserverContext) GetEntityId ¶
func (ctx *ObserverContext) GetEntityId() EntityId
type ObserverFunc ¶
type ObserverFunc func(ctx *ObserverContext) error
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Component Query
func (*Query) AtLeastOneOfThem ¶
func (*Query) AtLeastOneOfThemReadonly ¶
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
func (*QueryResult) ForeachEntities ¶
func (qr *QueryResult) ForeachEntities(fn func(accessor *ArcheTypeAccessor) error) error
func (*QueryResult) GetArcheType ¶
func (qr *QueryResult) GetArcheType(idx int) *ArcheType
func (*QueryResult) GetArcheTypeCount ¶
func (qr *QueryResult) GetArcheTypeCount() int
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) AddObserver ¶
func (r *Registry) AddObserver(name string, fn ObserverFunc) *Observer
func (*Registry) CreateEntity ¶
func (*Registry) IsActiveEntity ¶
func (*Registry) RemoveEntity ¶
type System ¶
type System struct {
// contains filtered or unexported fields
}
func (*System) GetPriority ¶
type SystemFn ¶
type SystemFn func(ctx *ExecutionContext) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.