Documentation ¶
Index ¶
- Constants
- func DispatchComponentEvent(c Component, t EventType, e Entity)
- func RegisterComponent(fn RegisterComponentFn)
- func RegisterSystem(fn RegisterSystemFn)
- func RegisterWorldDefaults(w World)
- type BaseSystem
- type Component
- type Entity
- type EntityFlag
- type EntityFlagSlice
- type Event
- type EventFn
- type EventListener
- type EventType
- type Flag
- type Locker
- type MatchFn
- type RegisterComponentFn
- type RegisterSystemFn
- type SortedEntities
- type System
- type View
- type World
Constants ¶
View Source
const MaxFlagCapacity = 256
Variables ¶
This section is empty.
Functions ¶
func DispatchComponentEvent ¶ added in v2.2.0
DispatchComponentEvent is a helper to dispatch component events
func RegisterComponent ¶
func RegisterComponent(fn RegisterComponentFn)
func RegisterSystem ¶
func RegisterSystem(fn RegisterSystemFn)
func RegisterWorldDefaults ¶
func RegisterWorldDefaults(w World)
Types ¶
type BaseSystem ¶
type BaseSystem struct {
// contains filtered or unexported fields
}
BaseSystem implements Enable(), Disable() and Enabled() from ecs.System
func (*BaseSystem) Enabled ¶
func (s *BaseSystem) Enabled() bool
Enabled returns if this system is enabled
type EntityFlag ¶
type EntityFlagSlice ¶
type EntityFlagSlice []EntityFlag
func (EntityFlagSlice) Len ¶
func (a EntityFlagSlice) Len() int
func (EntityFlagSlice) Less ¶
func (a EntityFlagSlice) Less(i, j int) bool
func (EntityFlagSlice) Swap ¶
func (a EntityFlagSlice) Swap(i, j int)
type EventListener ¶ added in v2.0.11
type Flag ¶
type Flag [4]uint64
Flag is a 256 bit binary flag
func MergeFlags ¶ added in v2.2.0
MergeFlags performs an OR operation to return a single flag
func (Flag) ContainsAny ¶ added in v2.1.0
ContainsAny tests if f contains at least one bit of g
type RegisterComponentFn ¶
type RegisterComponentFn func() Component
type RegisterSystemFn ¶
type RegisterSystemFn func() System
type SortedEntities ¶
type SortedEntities []Entity
SortedEntities implements sort.Interface
func (SortedEntities) Len ¶
func (a SortedEntities) Len() int
func (SortedEntities) Less ¶
func (a SortedEntities) Less(i, j int) bool
func (SortedEntities) Swap ¶
func (a SortedEntities) Swap(i, j int)
type World ¶
type World interface { RegisterComponent(c Component) IsRegistered(id string) bool CFlag(e Entity) Flag NewEntity() Entity RemoveEntity(e Entity) bool C(id string) Component S(id string) System CAdded(e Entity, c Component, key [4]byte) CRemoved(e Entity, c Component, key [4]byte) CWillResize(c Component, key [4]byte) CResized(c Component, key [4]byte) AddSystem(s System) error RemoveSystem(s System) EachSystem(func(s System) bool) Dispatch(e Event) Listen(mask EventType, fn EventFn) int64 RemoveListener(id int64) SetFlagGroup(name string, f Flag) FlagGroup(name string) Flag LGet(name string) interface{} LSet(name string, value interface{}) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.