Documentation
¶
Index ¶
- Variables
- type ArchetypeIterator
- type EntityIterator
- type HasEntitiesForArchetype
- type MockComponentType
- func (m *MockComponentType[T]) Decode(bytes []byte) (any, error)
- func (m *MockComponentType[T]) Encode(a any) ([]byte, error)
- func (m *MockComponentType[T]) GetSchema() []byte
- func (m *MockComponentType[T]) ID() component.TypeID
- func (m *MockComponentType[T]) Name() string
- func (m *MockComponentType[T]) New() ([]byte, error)
- func (m *MockComponentType[T]) SetID(id component.TypeID) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BadID entity.ID = math.MaxUint64 ErrComponentAlreadyOnEntity = errors.New("component already on entity") ErrComponentNotOnEntity = errors.New("component not on entity") ErrEntityMustHaveAtLeastOneComponent = errors.New("entities must have at least 1 component") // ErrComponentMismatchWithSavedState is an error that is returned when a TypeID from // the saved state is not found in the passed in list of components. ErrComponentMismatchWithSavedState = errors.New("registered components do not match with the saved state") )
Functions ¶
This section is empty.
Types ¶
type ArchetypeIterator ¶
func (*ArchetypeIterator) HasNext ¶
func (it *ArchetypeIterator) HasNext() bool
func (*ArchetypeIterator) Next ¶
func (it *ArchetypeIterator) Next() archetype.ID
type EntityIterator ¶
type EntityIterator struct {
// contains filtered or unexported fields
}
EntityIterator is an iterator for Ent lists in archetypes.
func NewEntityIterator ¶
func NewEntityIterator(current int, archAccessor HasEntitiesForArchetype, indices []archetype.ID) EntityIterator
NewEntityIterator returns an iterator for Entitys.
func (*EntityIterator) HasNext ¶
func (it *EntityIterator) HasNext() bool
HasNext returns true if there are more Ent list to iterate over.
type HasEntitiesForArchetype ¶
type MockComponentType ¶
type MockComponentType[T any] struct { // contains filtered or unexported fields }
func NewMockComponentType ¶
func NewMockComponentType[T component.Component](t T, defaultVal interface{}) (*MockComponentType[T], error)
func (*MockComponentType[T]) Decode ¶
func (m *MockComponentType[T]) Decode(bytes []byte) (any, error)
func (*MockComponentType[T]) GetSchema ¶
func (m *MockComponentType[T]) GetSchema() []byte
func (*MockComponentType[T]) ID ¶
func (m *MockComponentType[T]) ID() component.TypeID
func (*MockComponentType[T]) Name ¶
func (m *MockComponentType[T]) Name() string
func (*MockComponentType[T]) New ¶
func (m *MockComponentType[T]) New() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.