Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = NewRegistry()
Default is the package-level compatibility ECS registry used by legacy helpers.
Functions ¶
This section is empty.
Types ¶
type BaseEntity ¶
type BaseEntity struct {
// contains filtered or unexported fields
}
BaseEntity contains required fields
func NewBaseEntity
deprecated
func NewBaseEntity() *BaseEntity
NewBaseEntity return new entity.
Deprecated: use NewEntityFactory and EntityFactory.NewBaseEntity for explicit ID ownership.
func NewBaseEntityWithID
deprecated
func NewBaseEntityWithID(id uint64) *BaseEntity
NewBaseEntityWithID return new entity with id.
Deprecated: use NewEntityFactory and EntityFactory.NewBaseEntityWithID for explicit ID ownership.
func (*BaseEntity) GetVersion ¶
func (e *BaseEntity) GetVersion() uint64
GetVersion return current version of object
func (*BaseEntity) SetVersion ¶
func (e *BaseEntity) SetVersion(v uint64)
SetVersion set current version
type DefaultEntityFactoryHandle ¶ added in v1.1.0
type DefaultEntityFactoryHandle struct {
// contains filtered or unexported fields
}
DefaultEntityFactoryHandle restores a previous package-level entity factory.
func InstallDefaultEntityFactory ¶ added in v1.1.0
func InstallDefaultEntityFactory(factory *EntityFactory) *DefaultEntityFactoryHandle
InstallDefaultEntityFactory installs a scoped package-level entity factory.
func (*DefaultEntityFactoryHandle) Close ¶ added in v1.1.0
func (h *DefaultEntityFactoryHandle) Close() error
Close restores the previous package-level entity factory.
type EntityFactory
deprecated
added in
v1.1.0
type EntityFactory = Registry
EntityFactory aliases Registry for backward compatibility.
Deprecated: use Registry.
func DefaultEntityFactory ¶ added in v1.1.0
func DefaultEntityFactory() *EntityFactory
DefaultEntityFactory returns the package-level compatibility entity factory.
func NewEntityFactory
deprecated
added in
v1.1.0
func NewEntityFactory() *EntityFactory
NewEntityFactory returns an isolated ECS entity factory.
Deprecated: use NewRegistry.
type Registry ¶ added in v1.1.0
type Registry struct {
// contains filtered or unexported fields
}
Registry owns ECS entity ID generation state for application composition.
func NewRegistry ¶ added in v1.1.0
func NewRegistry() *Registry
NewRegistry returns an isolated ECS registry.
func (*Registry) LatestID ¶ added in v1.1.0
LatestID returns the latest generated entity ID for this registry.
func (*Registry) NewBaseEntity ¶ added in v1.1.0
func (r *Registry) NewBaseEntity() *BaseEntity
NewBaseEntity returns a new entity owned by this registry.
func (*Registry) NewBaseEntityWithID ¶ added in v1.1.0
func (r *Registry) NewBaseEntityWithID(id uint64) *BaseEntity
NewBaseEntityWithID returns a new entity with an explicit ID owned by this registry.
type Versionable ¶
type Versionable interface {
GetVersion() uint64
UpVersion()
}
Versionable describe version for entity