Versions in this module Expand all Collapse all v0 v0.2.0 Feb 13, 2022 Changes in this version type Entity + Name string type SystemManager + func (sm *SystemManager) Count() int + func (sm *SystemManager) Transition(w *World) (string, string) + type TransitionSystem interface + Transition func(w *World) (string, string) v0.1.0 Feb 5, 2022 Changes in this version + const Component0 + const Component1 + const Component10 + const Component11 + const Component12 + const Component13 + const Component14 + const Component15 + const Component16 + const Component17 + const Component18 + const Component19 + const Component2 + const Component20 + const Component21 + const Component22 + const Component23 + const Component24 + const Component25 + const Component26 + const Component27 + const Component28 + const Component29 + const Component3 + const Component30 + const Component31 + const Component32 + const Component33 + const Component34 + const Component35 + const Component36 + const Component37 + const Component38 + const Component39 + const Component4 + const Component40 + const Component41 + const Component42 + const Component43 + const Component44 + const Component45 + const Component46 + const Component47 + const Component48 + const Component49 + const Component5 + const Component50 + const Component51 + const Component52 + const Component53 + const Component54 + const Component55 + const Component56 + const Component57 + const Component58 + const Component59 + const Component6 + const Component60 + const Component61 + const Component62 + const Component63 + const Component7 + const Component8 + const Component9 + var ErrSceneAdded = errors.New("scene already added") + var ErrSceneInUse = errors.New("scene is currently in use") + var ErrSceneUnavailable = errors.New("scene not available") + var ErrSystemAdded = errors.New("system already added") + var ErrSystemUnavailable = errors.New("system not available") + var ErrWorldAdded = errors.New("world already added") + var ErrWorldInUse = errors.New("world is currently in use") + var ErrWorldUnavailable = errors.New("world not available") + type Component interface + Mask func() uint64 + type DrawSystem interface + Draw func(w *World, canvas *ebiten.Image, dt float64) + type Entity struct + ID ulid.ULID + Mask uint64 + func NewEntity(cs ...Component) *Entity + func (e *Entity) AddComponent(c Component) + func (e *Entity) Component(mask uint64) Component + func (e *Entity) Components() []Component + func (e *Entity) HasComponent(mask uint64) bool + func (e *Entity) RemoveComponent(mask uint64) + type EntityManager struct + func NewEntityManager() *EntityManager + func (em *EntityManager) Add(es ...*Entity) + func (em *EntityManager) FilterByComponent(c Component) []*Entity + func (em *EntityManager) FilterByID(id ulid.ULID) *Entity + func (em *EntityManager) FilterByMask(mask uint64) []*Entity + func (em *EntityManager) New(cs ...Component) *Entity + func (em *EntityManager) RemoveByComponent(c Component) int + func (em *EntityManager) RemoveByID(id ulid.ULID) bool + func (em *EntityManager) RemoveByMask(mask uint64) int + type Scene struct + Entities *EntityManager + Name string + func NewScene(name string) *Scene + func (s *Scene) AddEntity(es ...*Entity) + func (s *Scene) FilterEntitiesByComponent(c Component) []*Entity + func (s *Scene) FilterEntitiesByMask(mask uint64) []*Entity + func (s *Scene) FilterEntityByID(id ulid.ULID) *Entity + func (s *Scene) NewEntity(cs ...Component) *Entity + func (s *Scene) RemoveEntitiesByComponent(c Component) int + func (s *Scene) RemoveEntitiesByMask(mask uint64) int + func (s *Scene) RemoveEntityByID(id ulid.ULID) bool + type SceneManager struct + Active *Scene + func NewSceneManager() *SceneManager + func (sm *SceneManager) Add(ss ...*Scene) error + func (sm *SceneManager) Names(sorted bool) []string + func (sm *SceneManager) New(name string) (*Scene, error) + func (sm *SceneManager) Remove(name string) error + func (sm *SceneManager) Scene(name string) *Scene + func (sm *SceneManager) Scenes(sorted bool) []*Scene + func (sm *SceneManager) Switch(name string) error + type System interface + Init func(w *World) error + Stop func(w *World) error + type SystemManager struct + func NewSystemManager() *SystemManager + func (sm *SystemManager) Add(s System) error + func (sm *SystemManager) Disable(s System) error + func (sm *SystemManager) Draw(w *World, canvas *ebiten.Image) + func (sm *SystemManager) Enable(s System) error + func (sm *SystemManager) Init(w *World) error + func (sm *SystemManager) Remove(s System) error + func (sm *SystemManager) Stop(w *World) error + func (sm *SystemManager) Systems() []System + func (sm *SystemManager) Update(w *World) error + type UpdateSystem interface + Update func(w *World, dt float64) error + type World struct + Name string + Scenes *SceneManager + Systems *SystemManager + func NewWorld(name string) *World + func (w *World) ActiveScene() *Scene + func (w *World) AddScene(ss ...*Scene) error + func (w *World) AddSystem(s System) error + func (w *World) DisableSystem(s System) error + func (w *World) EnableSystem(s System) error + func (w *World) NewScene(name string) (*Scene, error) + func (w *World) RemoveScene(name string) error + func (w *World) RemoveSystem(s System) error + func (w *World) Scene(name string) *Scene + func (w *World) SwitchScene(name string) error + type WorldManager struct + Active *World + func NewWorldManager() *WorldManager + func (wm *WorldManager) Add(ws ...*World) error + func (wm *WorldManager) Names(sorted bool) []string + func (wm *WorldManager) New(name string) (*World, error) + func (wm *WorldManager) Remove(name string) error + func (wm *WorldManager) Switch(name string) error + func (wm *WorldManager) World(name string) *World + func (wm *WorldManager) Worlds(sorted bool) []*World