systems

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package systems provides the various systems used by the engine

Index

Constants

View Source
const (
	// TypeAnimator is the name of the animator system.
	TypeAnimator = "animator"
)
View Source
const (
	// TypeMovement is the name of the movement system.
	TypeMovement = "mover"
)
View Source
const (
	// TypeRenderer is the name of the renderer system.
	TypeRenderer = "renderer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Movement

type Movement interface {
	System
	// Process updates entities position based on their velocities.
	Process(elapsed float32)
}

Movement represents a system that knows how to alter an Entity's position based on its velocities.

func NewMovement

func NewMovement() Movement

NewMovement creates a new Movement system.

type Renderer

type Renderer interface {
	System
	// Process renders all renderable entities.
	Process()
	// LoadCamera sets the camera to be used by the display.
	LoadCamera(camera components.Camera)
}

Renderer provides the interface needed to process the rendering of Entities. Each time Process is called all Entities will be rendered.

func NewRenderer

func NewRenderer(assetManager *am.Manager, mainFunc func(f func()), window *glfw.Window) Renderer

NewRenderer creates a new renderer system. The renderer system handles rendering all renderable Entities to the screen.

type System

type System interface {
	// Type retrieves the type of system such as renderer, mover, etc.
	Type() string
	// AddEntity adds an Entity to the system.  Each system will have a component requirement that must be met before the Entity can be added.
	AddEntity(e entity.Entity)
	// RemoveEntity removes an Entity from the system.
	RemoveEntity(e entity.Entity)
	// IsRunning returns true if the system is currently processing entities, false otherwise.
	IsRunning() bool
	// Start causes the system to begin processing all Entities which have been added.
	Start()
	// Stop stops the system.  Entities are not removed, but the the system will not perform any additional processing until it is started again.
	Stop()
	// Terminate stops the system and cleans up all resources.
	Terminate()
}

System represents the behavior all engine systems should implement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL