game

package
v3.0.1-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCreateGame

type ErrCreateGame struct {
	Err error
}

func (*ErrCreateGame) Error

func (e *ErrCreateGame) Error() string

type Event

type Event struct {
	Type    EventType   `json:"type"`
	Payload interface{} `json:"payload"`
}

type EventType

type EventType uint8
const (
	EventTypeError EventType = iota
	EventTypeObjectCreate
	EventTypeObjectDelete
	EventTypeObjectUpdate
	EventTypeObjectChecked
)

func (EventType) MarshalJSON

func (event EventType) MarshalJSON() ([]byte, error)

func (EventType) String

func (event EventType) String() string

type Game

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

func NewGame

func NewGame(logger logrus.FieldLogger, width, height uint8) (*Game, error)

func (*Game) ListenEvents

func (g *Game) ListenEvents(stop <-chan struct{}, buffer uint) <-chan Event

func (*Game) Start

func (g *Game) Start(stop <-chan struct{})

func (*Game) World

func (g *Game) World() *world.World

type ObserverInterface

type ObserverInterface interface {
	Observe(stop <-chan struct{}, world *world.World)
}

Jump to

Keyboard shortcuts

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