game

package
v2.0.0-rc-2016+incompa... Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_TYPE_ERROR = iota
	EVENT_TYPE_OBJECT_CREATING
	EVENT_TYPE_OBJECT_DELETING
	EVENT_TYPE_OBJECT_UPDATING
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string          `json:"command"`
	Params  json.RawMessage `json:"params"`
}

type Game

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

func NewGame

func NewGame(cxt context.Context, pgW, pgH uint8) (*Game, error)

func (*Game) StartGame

func (g *Game) StartGame() <-chan interface{}

func (*Game) StartPlayer

func (g *Game) StartPlayer(cxt context.Context, input <-chan *Command,
) (<-chan interface{}, error)

type GameObjectCollection

type GameObjectCollection map[uint16]interface{}

type GameProcessor

type GameProcessor chan interface{}

func NewGameProcessor

func NewGameProcessor() GameProcessor

func (GameProcessor) OccurredCreating

func (p GameProcessor) OccurredCreating(object interface{})

Implementing game objects.GameProcessor

func (GameProcessor) OccurredDeleting

func (p GameProcessor) OccurredDeleting(object interface{})

Implementing game objects.GameProcessor

func (GameProcessor) OccurredError

func (p GameProcessor) OccurredError(object interface{}, err error)

Implementing game objects.GameProcessor

func (GameProcessor) OccurredUpdating

func (p GameProcessor) OccurredUpdating(object interface{})

Implementing game objects.GameProcessor

type Notice

type Notice struct {
}

type Object

type Object json.Marshaler

type ObjectSet

type ObjectSet map[uint16]Object

type StartPlayerFunc

type StartPlayerFunc func(cxt context.Context, input <-chan *Command,
) (<-chan interface{}, error)

Directories

Path Synopsis
This package provides simple small engine for flat games.
This package provides simple small engine for flat games.

Jump to

Keyboard shortcuts

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