game

package
v4.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 5 Imported by: 6

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"`
}

ffjson: nodecoder

func (*Event) MarshalJSON

func (j *Event) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Event) MarshalJSONBuf

func (j *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

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.Interface

Jump to

Keyboard shortcuts

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