Documentation ¶
Index ¶
- Constants
- type ByZ
- type CameraSystem
- type CollisionSystem
- type Command
- type EntityManagerItems
- type GameSystem
- type InputSystem
- type MyEntityManager
- func (s *MyEntityManager) Add(entity ecs.Entity, systemIDs ...string)
- func (s *MyEntityManager) Delete(id uint64, systemIDs ...string)
- func (s MyEntityManager) Get(id uint64) ecs.Entity
- func (s *MyEntityManager) HandleMessage(msg ecs.Message, data interface{}) interface{}
- func (s *MyEntityManager) Init(mngr *ecs.SystemManager)
- func (s MyEntityManager) Priority() uint
- func (s *MyEntityManager) Update(dt float64)
- type PlayerHandlingSystem
- type RenderSystem
Constants ¶
const ( // System Messages MessageGeneric ecs.Message = iota MessageCameraUpdate MessageGetCommands MessageGetEntitiesOfSystem MessageSetEntityLocation MessageGetGameSnapshot // Game Messages MessageGameQuit MessageGameChangeScene MessageCount )
The Message enum
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CameraSystem ¶
type CameraSystem struct {
// contains filtered or unexported fields
}
CameraSystem defines the system to process input.
func NewCameraSystem ¶
func NewCameraSystem(camera parts.CameraInterface) *CameraSystem
NewCameraSystem returns a pointer to a new CameraSystem.
func (*CameraSystem) Add ¶
func (s *CameraSystem) Add(e *ecs.Entity)
Add adds an entity to the system.
func (*CameraSystem) Delete ¶
func (s *CameraSystem) Delete(e ecs.Entity)
Delete deletes an entity from this system.
func (CameraSystem) HandleMessage ¶
func (s CameraSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*CameraSystem) Init ¶
func (s *CameraSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (*CameraSystem) Update ¶
func (s *CameraSystem) Update(dt float64)
Update handles the update of the system.
type CollisionSystem ¶
type CollisionSystem struct {
// contains filtered or unexported fields
}
func NewCollisionSystem ¶
func NewCollisionSystem() *CollisionSystem
NewPlayerHandlingSystem returns a pointer to a new PlayerHandlingSystem.
func (*CollisionSystem) HandleMessage ¶
func (s *CollisionSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*CollisionSystem) Init ¶
func (s *CollisionSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (CollisionSystem) Priority ¶
func (s CollisionSystem) Priority() uint
Priority defines the priority of this system.
func (*CollisionSystem) Update ¶
func (s *CollisionSystem) Update(dt float64)
Update handles the update of the system.
type EntityManagerItems ¶
type EntityManagerItems struct {
// contains filtered or unexported fields
}
type GameSystem ¶
type GameSystem struct {
// contains filtered or unexported fields
}
GameSystem defines the system to access the game objects.
func NewGameSystem ¶
func NewGameSystem(game *ecs.GameInterface) *GameSystem
NewGameSystem returns a pointer to a new GameSystem.
func (*GameSystem) HandleMessage ¶
func (s *GameSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*GameSystem) Init ¶
func (s *GameSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (GameSystem) Priority ¶
func (s GameSystem) Priority() uint
Priority defines the priority of this system.
func (*GameSystem) Update ¶
func (s *GameSystem) Update(dt float64)
Update handles the update of the system.
type InputSystem ¶
type InputSystem struct {
// contains filtered or unexported fields
}
InputSystem defines the system to process input.
func NewInputSystem ¶
func NewInputSystem(game ecs.GameInterface) *InputSystem
NewInputSystem returns a pointer to a new InputSystem.
func (InputSystem) HandleMessage ¶
func (s InputSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*InputSystem) Init ¶
func (s *InputSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (InputSystem) Priority ¶
func (s InputSystem) Priority() uint
Priority defines the priority of this system.
func (*InputSystem) Update ¶
func (s *InputSystem) Update(dt float64)
Update handles the update of the system.
type MyEntityManager ¶
type MyEntityManager struct {
// contains filtered or unexported fields
}
MyEntityManager implements the ecs/EntityManager interface.
func NewMyEntityManager ¶
func NewMyEntityManager() *MyEntityManager
NewMyEntityManager returns a new MyEntityManager.
func (*MyEntityManager) Add ¶
func (s *MyEntityManager) Add(entity ecs.Entity, systemIDs ...string)
Add adds an entity to this manager.
func (*MyEntityManager) Delete ¶
func (s *MyEntityManager) Delete(id uint64, systemIDs ...string)
Delete removes an entity from this manager. if systemIDs is nil, delete entire entity, else only the systems defined.
func (MyEntityManager) Get ¶
func (s MyEntityManager) Get(id uint64) ecs.Entity
Get returns an entity managed by this manager.
func (*MyEntityManager) HandleMessage ¶
func (s *MyEntityManager) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*MyEntityManager) Init ¶
func (s *MyEntityManager) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (MyEntityManager) Priority ¶
func (s MyEntityManager) Priority() uint
Priority defines the priority of this system.
func (*MyEntityManager) Update ¶
func (s *MyEntityManager) Update(dt float64)
Update handles the update of the system.
type PlayerHandlingSystem ¶
type PlayerHandlingSystem struct {
// contains filtered or unexported fields
}
func NewPlayerHandlingSystem ¶
func NewPlayerHandlingSystem() *PlayerHandlingSystem
NewPlayerHandlingSystem returns a pointer to a new PlayerHandlingSystem.
func (*PlayerHandlingSystem) HandleMessage ¶
func (s *PlayerHandlingSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*PlayerHandlingSystem) Init ¶
func (s *PlayerHandlingSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (PlayerHandlingSystem) Priority ¶
func (s PlayerHandlingSystem) Priority() uint
Priority defines the priority of this system.
func (*PlayerHandlingSystem) Update ¶
func (s *PlayerHandlingSystem) Update(dt float64)
Update handles the update of the system.
type RenderSystem ¶
type RenderSystem struct {
// contains filtered or unexported fields
}
RenderSystem defines the system to render stuff to the screen.
func NewRenderSystem ¶
func NewRenderSystem( renderer *sdl.Renderer, camera parts.CameraInterface) *RenderSystem
NewRenderSystem returns a pointer to a new RenderSystem.
func (*RenderSystem) HandleMessage ¶
func (s *RenderSystem) HandleMessage( msg ecs.Message, data interface{}) interface{}
HandleMessage handles any messages that need to be dealt with.
func (*RenderSystem) Init ¶
func (s *RenderSystem) Init(mngr *ecs.SystemManager)
Init initializes the system.
func (RenderSystem) Priority ¶
func (s RenderSystem) Priority() uint
Priority defines the priority of this system.
func (*RenderSystem) Update ¶
func (s *RenderSystem) Update(dt float64)
Update handles the update of the system.