Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query interface { Evaluate(mask *toolkit.DynamicBitSet) bool String() string }
func Equal ¶
func Equal(componentIds ...ComponentId) Query
Equal 当实体组件完全等于 componentIds 中的所有 ComponentId 时,条件成立
func In ¶
func In(componentIds ...ComponentId) Query
In 当实体组件包含 componentIds 中的所有 ComponentId 时,条件成立
func NotIn ¶
func NotIn(componentIds ...ComponentId) Query
NotIn 当实体组件不包含 componentIds 中的所有 ComponentId 时,条件成立
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) Iterator ¶
func (r *Result) Iterator() ResultIterator
type ResultIterator ¶
type ResultIterator struct {
// contains filtered or unexported fields
}
func (*ResultIterator) Entity ¶
func (r *ResultIterator) Entity() Entity
func (*ResultIterator) Get ¶
func (r *ResultIterator) Get(componentId ComponentId) any
func (*ResultIterator) Next ¶
func (r *ResultIterator) Next() bool
func (*ResultIterator) Reset ¶
func (r *ResultIterator) Reset()
type Storage ¶
type Storage = storage.Storage[entityId, ComponentId]
type World ¶
type World interface { Alive(entity Entity) bool Get(entity Entity, componentId ComponentId) any Query(query Query) *Result QueryF(query Query, handler func(result *Result)) RegComponent(component any) ComponentId Spawn(componentIds ...ComponentId) Entity Spawns(count int, componentIds ...ComponentId) []Entity Annihilate(entity Entity) Annihilates(entities []Entity) Update() SetSleep(d time.Duration) SetTimeScale(scale float64) TimeScale() float64 DeltaTime() time.Duration Pause() Resume() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.