ecs

package
v0.0.0-...-3b43014 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	ID() EntityID
}

type EntityID

type EntityID = uint64

func (EntityID) ID

func (e EntityID) ID() EntityID

type System

type System interface {
	// Update updates the system. It is invoked by the engine once every frame,
	// with dt being the duration since the previous update.
	Update(dt float64)

	// Remove removes the given entity from the system.
	Remove(id EntityID)
}

type World

type World struct {
	// contains filtered or unexported fields
}

func (*World) AddSystem

func (w *World) AddSystem(system System)

AddSystem adds the given System to the World, sorted by priority.

func (*World) NewEntity

func (w *World) NewEntity() EntityID

func (*World) RemoveEntity

func (w *World) RemoveEntity(id EntityID)

RemoveEntity removes the entity across all systems.

func (*World) Systems

func (w *World) Systems() []System

Systems returns the list of Systems managed by the World.

func (*World) Update

func (w *World) Update(dt float64)

Update updates each System managed by the World. It is invoked by the engine once every frame, with dt being the duration since the previous update.

Jump to

Keyboard shortcuts

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