player

package
v3.1.1-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 12, 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 Message

type Message struct {
	Type    MessageType `json:"type"`
	Payload interface{} `json:"payload"`
}

func NewMessageCountdown

func NewMessageCountdown(countdown uint) Message

func NewMessageError

func NewMessageError(errorStr string) Message

func NewMessageNotice

func NewMessageNotice(notice string) Message

func NewMessageObjects

func NewMessageObjects(objects []interface{}) Message

func NewMessageSize

func NewMessageSize(w, h uint8) Message

func NewMessageSnake

func NewMessageSnake(uuid string) Message

type MessageCountdown

type MessageCountdown uint

type MessageError

type MessageError string

type MessageNotice

type MessageNotice string

type MessageObjects

type MessageObjects []interface{}

type MessageSize

type MessageSize struct {
	Width  uint8 `json:"width"`
	Height uint8 `json:"height"`
}

type MessageSnake

type MessageSnake string

type MessageType

type MessageType uint8
const (
	MessageTypeSize MessageType = iota
	MessageTypeSnake
	MessageTypeNotice
	MessageTypeError
	MessageTypeCountdown
	MessageTypeObjects
)

func (MessageType) MarshalJSON

func (t MessageType) MarshalJSON() ([]byte, error)

func (MessageType) String

func (t MessageType) String() string

type Player

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

func NewPlayer

func NewPlayer(logger logrus.FieldLogger, world *world.World) *Player

func (*Player) Start

func (p *Player) Start(stop <-chan struct{}, chin <-chan string) <-chan Message

Jump to

Keyboard shortcuts

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