Versions in this module Expand all Collapse all v0 v0.0.1 Mar 12, 2024 Changes in this version + type Buffer struct + type ComToBool func(IComponent) bool + type Component struct + func NewComponent(t TComponent) Component + func (c *Component) Dispose() + func (c *Component) Entity() *Entity + func (c *Component) Init() + func (c *Component) Start() + func (c *Component) Type() TComponent + type Entity struct + func NewEntity(id string) *Entity + func (e *Entity) AddComponent(c IComponent) *util.Err + func (e *Entity) AddComponents(components ...IComponent) + func (e *Entity) Components() []IComponent + func (e *Entity) DelComponent(t TComponent) bool + func (e *Entity) Dispose() + func (e *Entity) GetComponent(t TComponent) (IComponent, bool) + func (e *Entity) Id() string + func (e *Entity) IterComponent(fn func(IComponent)) + func (e *Entity) Scene() *Scene + type EntityToBool func(*Entity) bool + type EntityToErr func(*Entity) *util.Err + type EntityToEvent func(*Entity) IEvent + type FnBufferJob func(JobName, *Buffer, []any) + type FnCom func(IComponent) + type FnComponentBuffer func(IComponent, *Buffer) + type FnEntity func(*Entity) + type FnEntityBuffer func(*Entity, *Buffer) + type FnEntityCom func(*Entity, IComponent) + type FnEntityEvent func(*Entity, IEvent) + type FnEntityFrame func(*Entity, *Frame) + type FnEntityStr func(*Entity, string) + type FnEntityTCom func(*Entity, TComponent) + type FnEvent func(IEvent) + type FnEvents func([]IEvent) + type FnFrame func(*Frame) + type FnJob func([]any) + type FnLinkAnySlc func(*ds.FnLink, []any) + type FnScene func(*Scene) + type FnSceneM func(*Scene, util.M) + type FnSceneStr func(*Scene, string) + type Frame struct + func NewFrame(scene *Scene, opts ...FrameOption) *Frame + func (f *Frame) AddSystem(system ISystem, before TSystem) + func (f *Frame) After() *ds.FnLink + func (f *Frame) AfterClearTags(tags ...string) + func (f *Frame) Before() *ds.FnLink + func (f *Frame) DelSystem(t TSystem) + func (f *Frame) DeltaMillSec() int64 + func (f *Frame) GetSystem(typ TSystem) (ISystem, bool) + func (f *Frame) NowMillSecs() int64 + func (f *Frame) Num() int64 + func (f *Frame) PushJob(name JobName, data ...any) + func (f *Frame) PutJob(name JobName, data ...any) + func (f *Frame) Scene() *Scene + func (f *Frame) Start() + func (f *Frame) StartTime() int64 + func (f *Frame) Stop() + type FrameOption func(o *frameOption) + func FrameBeforeDispose(fn FnFrame) FrameOption + func FrameMax(frames int64) FrameOption + func FrameSystems(systems ...ISystem) FrameOption + func FrameTickDur(dur time.Duration) FrameOption + type IComponent interface + Dispose func() + Entity func() *Entity + Init func() + Start func() + Type func() TComponent + func PTagComponentsToLink[T any](s *Scene, tag string, fn func(IComponent, *ds.Link[T]), pcr func(*ds.Link[T])) ([]IComponent, bool) + func PTagComponentsTo[T any](s *System, tag string, fn func(IComponent) T, complete func([]T)) ([]IComponent, bool) + type IEvent interface + Type func() TEvent + type ISystem interface + BindJob func(name JobName, handler util.FnAnySlc) + BindPFnJob func(name JobName, fn FnLinkAnySlc) + BindPJob func(name JobName, fn util.FnAnySlc) + DoJob func(name JobName) + Frame func() *Frame + FrameAfter func() *ds.FnLink + FrameBefore func() *ds.FnLink + OnAfterStart func() + OnBeforeStart func() + OnStart func(frame *Frame) + OnStop func() + OnUpdate func() + PTagComponents func(tag string, fn func(IComponent)) ([]IComponent, bool) + PTagComponentsToFnLink func(tag string, fn func(IComponent, *ds.FnLink)) ([]IComponent, bool) + PTagComponentsToFnLinkWithParams func(tag string, fn func(IComponent, []any, *ds.FnLink), params ...any) ([]IComponent, bool) + PTagComponentsWithParams func(tag string, fn func(IComponent, []any), params ...any) ([]IComponent, bool) + PutJob func(name JobName, data ...any) + Scene func() *Scene + Type func() TSystem + type JobName = string + type Scene struct + func NewScene(id string, typ TScene) *Scene + func (s *Scene) AddEntity(e *Entity) *util.Err + func (s *Scene) BindAddComponent(fn FnEntityCom) + func (s *Scene) BindAfterAddEntity(fn FnEntity) + func (s *Scene) BindAfterDisposeEntity(fn FnEntity) + func (s *Scene) BindBeforeAddEntity(fn EntityToErr) + func (s *Scene) BindBeforeDisposeEntity(fn EntityToErr) + func (s *Scene) BindDelComponent(fn FnEntityTCom) + func (s *Scene) ClearComponentTags(component IComponent) + func (s *Scene) ClearTag(tag string) bool + func (s *Scene) ClearTags(tags ...string) + func (s *Scene) Data() util.M + func (s *Scene) DelEntity(id string) *util.Err + func (s *Scene) Dispose() + func (s *Scene) Entities() []*Entity + func (s *Scene) EntityCount() int + func (s *Scene) EntityIds(ids *[]string) + func (s *Scene) GetEntity(id string) (*Entity, bool) + func (s *Scene) GetTagComponents(tag string) ([]IComponent, bool) + func (s *Scene) HasTagComponent(component IComponent, tag string) bool + func (s *Scene) Id() string + func (s *Scene) IsEmpty() bool + func (s *Scene) IterEntities(fn FnEntity) + func (s *Scene) TagComponent(component IComponent, tags ...string) + func (s *Scene) TagEntityComponent(entityId string, t TComponent, tags ...string) + func (s *Scene) TestGetTagComponents(tag string) (*ds.SetItem[string, IComponent], bool) + func (s *Scene) TransferComponentTag(target string, origin string) + func (s *Scene) Type() TScene + func (s *Scene) UntagComponent(component IComponent, tags ...string) + type SceneToErr func(*Scene) *util.Err + type System struct + func NewSystem(t TSystem) System + func (s *System) BindJob(name JobName, fn util.FnAnySlc) + func (s *System) BindPFnJob(name JobName, fn FnLinkAnySlc) + func (s *System) BindPJob(name JobName, fn util.FnAnySlc) + func (s *System) DoJob(name JobName) + func (s *System) Frame() *Frame + func (s *System) FrameAfter() *ds.FnLink + func (s *System) FrameBefore() *ds.FnLink + func (s *System) Jobs() []worker.JobName + func (s *System) OnAfterStart() + func (s *System) OnBeforeStart() + func (s *System) OnStart(frame *Frame) + func (s *System) OnStop() + func (s *System) OnUpdate() + func (s *System) PEntities(fn func(*Entity)) []*Entity + func (s *System) PEntitiesWithParams(fn func(*Entity, []any), params ...any) []*Entity + func (s *System) PTagComponents(tag string, fn func(IComponent)) ([]IComponent, bool) + func (s *System) PTagComponentsToFnLink(tag string, fn func(IComponent, *ds.FnLink)) ([]IComponent, bool) + func (s *System) PTagComponentsToFnLinkWithParams(tag string, fn func(IComponent, []any, *ds.FnLink), params ...any) ([]IComponent, bool) + func (s *System) PTagComponentsWithParams(tag string, fn func(IComponent, []any), params ...any) ([]IComponent, bool) + func (s *System) PutJob(name worker.JobName, data ...any) + func (s *System) Scene() *Scene + func (s *System) Type() TSystem + type TComponent string + type TEvent string + type TJob uint8 + const JobDef + const JobP + const JobPLink + type TScene string + type TSystem string + type ToEvent func() IEvent