world

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package world allows to create an use our ECS World

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener added in v1.1.0

type Listener func(wld *World, signal interface{}, delta float32) error

Listener the get notified that a new signal has been received by World.Signal

type System added in v0.1.3

type System func(wld *World, delta float32) error

System get invoke with Update() from a World

type World

type World struct {
	*view.View
	// contains filtered or unexported fields
}

World is a view.View that contains the entity.Entity and System of our ECS

func New

func New() *World

New creates a new World

func (*World) AddSystem

func (wld *World) AddSystem(sys System)

AddSystem adds the given System to the world

func (*World) AddSystemWithPriority added in v0.1.6

func (wld *World) AddSystemWithPriority(sys System, priority int32)

AddSystemWithPriority adds the given System to the world

func (*World) Clear added in v0.1.10

func (wld *World) Clear()

Clear removes all world.System and entity.Entity from the world.World

func (*World) Listen added in v1.1.0

func (wld *World) Listen(lis Listener)

Listen adds the given System to the world

func (*World) ListenWithPriority added in v1.1.0

func (wld *World) ListenWithPriority(lis Listener, priority int32)

ListenWithPriority adds the given System to the world

func (*World) Signal added in v1.1.0

func (wld *World) Signal(event interface{}) error

Signal signal an event to be sent

func (World) String

func (wld World) String() string

String get a string representation of our World

func (*World) Update

func (wld *World) Update(delta float32) error

Update ask to update the System send the pending events

Jump to

Keyboard shortcuts

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