Documentation ¶
Index ¶
- type Component
- type ComponentManager
- func (manager *ComponentManager) AddComponent(entity Entity, component Component)
- func (manager *ComponentManager) GetComponent(entity Entity, componentName string) (Component, bool)
- func (manager *ComponentManager) HasComponent(entity Entity, componentName string) bool
- func (manager *ComponentManager) HasComponents(entity Entity, componentNames ...string) bool
- type Entity
- type EntityManager
- type System
- type SystemManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentManager ¶
type ComponentManager struct {
// contains filtered or unexported fields
}
func NewComponentManager ¶
func NewComponentManager() *ComponentManager
NewComponentManager creates a new instance of ComponentManager.
func (*ComponentManager) AddComponent ¶
func (manager *ComponentManager) AddComponent(entity Entity, component Component)
AddComponent adds a component a entity
func (*ComponentManager) GetComponent ¶
func (manager *ComponentManager) GetComponent(entity Entity, componentName string) (Component, bool)
GetComponent returns the component if it exists.
func (*ComponentManager) HasComponent ¶
func (manager *ComponentManager) HasComponent(entity Entity, componentName string) bool
HasComponent returns true if the entity has the component.
func (*ComponentManager) HasComponents ¶
func (manager *ComponentManager) HasComponents(entity Entity, componentNames ...string) bool
HasComponents returns true if the entity has all the components in the list.
type EntityManager ¶
type EntityManager struct {
// contains filtered or unexported fields
}
func NewEntityManager ¶
func NewEntityManager() *EntityManager
NewEntityManager instantiates a new EntityManager.
func (*EntityManager) DestroyEntity ¶
func (manager *EntityManager) DestroyEntity(entity Entity)
DestroyEntity destroys an entity.
func (*EntityManager) GetAllEntities ¶
func (manager *EntityManager) GetAllEntities() []Entity
GetAllEntities returns all entities.
func (*EntityManager) HasEntity ¶
func (manager *EntityManager) HasEntity(entity Entity) bool
HasEntity returns true if the entity exists.
func (*EntityManager) NewEntity ¶
func (manager *EntityManager) NewEntity() Entity
NewEntity creates a new entity.
type SystemManager ¶
type SystemManager struct {
// contains filtered or unexported fields
}
func NewSystemManager ¶
func NewSystemManager() *SystemManager
NewSystemManager instantiates a new SystemManager.
func (*SystemManager) AddSystem ¶
func (manager *SystemManager) AddSystem(system System)
AddSystem adds a system to the SystemManager.
func (*SystemManager) DrawSystems ¶
func (manager *SystemManager) DrawSystems()
DrawSystems iterates through the systems in the SystemManager and calls the Draw method on each system.
func (*SystemManager) GetAllSystems ¶
func (manager *SystemManager) GetAllSystems() []System
GetAllSystems returns all systems in the SystemManager.
func (*SystemManager) UpdateSystems ¶
func (manager *SystemManager) UpdateSystems(dt float32)
UpdateSystems updates all systems in the SystemManager with the given delta time.