Documentation ¶
Index ¶
Constants ¶
const ( // LogTypeDebug is debug log message type. LogTypeDebug = iota // LogTypeError is error log message type. LogTypeError = iota )
Variables ¶
This section is empty.
Functions ¶
func RenderSystem ¶
RenderSystem is an ECS system that renders SpriteComponents.
Types ¶
type Entity ¶
type Entity struct {
SpriteComponent *SpriteComponent
}
Entity is simply a collection of ECS components.
type EntityBuilder ¶
type EntityBuilder struct {
// contains filtered or unexported fields
}
EntityBuilder is a helper struct that builds entities
func NewEntityBuilder ¶
func NewEntityBuilder() *EntityBuilder
NewEntityBuilder makes a new instance of EntityBuilder.
func (EntityBuilder) AddSprite ¶
func (entityBuilder EntityBuilder) AddSprite(renderer *sdl.Renderer, file string) EntityBuilder
AddSprite adds sprite to building entity.
func (EntityBuilder) Build ¶
func (entityBuilder EntityBuilder) Build() *Entity
Build is a final method to call and it returns built entity.
func (EntityBuilder) SetLocation ¶
func (entityBuilder EntityBuilder) SetLocation(x int32, y int32) EntityBuilder
SetLocation sets location of the sprite using x and y coordinates.
type EntityManager ¶
type EntityManager struct {
// contains filtered or unexported fields
}
EntityManager is a helper struct that manages all entities.
func NewEntityManager ¶
func NewEntityManager() *EntityManager
NewEntityManager makes a new instance of EntityManager.
func (*EntityManager) AddEntity ¶
func (entityManager *EntityManager) AddEntity(entity *Entity)
AddEntity adds entity into the list.
func (*EntityManager) GetEntities ¶
func (entityManager *EntityManager) GetEntities() *[]*Entity
GetEntities retrieves entities from EntityManager.
type SpriteComponent ¶
SpriteComponent is an ECS component that stores texture.
func NewSpriteComponent ¶
func NewSpriteComponent(renderer *sdl.Renderer, file string) (*SpriteComponent, error)
NewSpriteComponent makes a new instance of SpriteComponent by reading the BMP file.