world

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 5 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 System added in v0.1.3

type System interface {
	// Update ask the System to Update the World, when World.Update get invoke
	Update(world *World, delta float32) error
	// Notify the System that a new event has been received by World.Notify
	Notify(world *World, event interface{}, delta float32) error
}

System get invoke with Update() and Notify() 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) Notify added in v0.1.2

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

Notify add an event to be sent

func (*World) RemoveSystem added in v0.1.9

func (wld *World) RemoveSystem(sys System) error

RemoveSystem deletes the given System from the world

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