Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { Managers []IManager // contains filtered or unexported fields }
Engine Game engine Only 1 should be initialised
func (*Engine) AddManager ¶
AddManager Adds a new manager to the engine
func (*Engine) Close ¶
func (engine *Engine) Close()
Close marks the engine to exit at the end of the current loop
func (*Engine) Initialise ¶
func (engine *Engine) Initialise()
Initialise the engine, and attached managers
func (*Engine) SetSimulationSpeed ¶
SetSimulationSpeed allows for speeding up and slowing down the game clock
type IManager ¶
type IManager interface { Register() RunConcurrent() Update(float64) Unregister() PostUpdate() }
IManager Generic game manager. Different systems should implement these methods
type Manager ¶
type Manager struct { }
Manager Managers exist to create and handle behaviour.
func (*Manager) PostUpdate ¶
func (manager *Manager) PostUpdate()
PostUpdate Called at the end of each loop.
func (*Manager) Register ¶
func (manager *Manager) Register()
Register this manager in the engine. This is called by the engine when the system is attached.
func (*Manager) RunConcurrent ¶
func (manager *Manager) RunConcurrent()
RunConcurrent If this manager is supported to run concurrently, custom concurrency function should be defined here
func (*Manager) Unregister ¶
func (manager *Manager) Unregister()
Unregister Called when this manager is detached and destroyed by the engine