snake

package
v3.0.2-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command string
const (
	CommandToNorth Command = "north"
	CommandToEast  Command = "east"
	CommandToSouth Command = "south"
	CommandToWest  Command = "west"
)

type Snake

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

Snake object

func NewSnake

func NewSnake(world *world.World) (*Snake, error)

NewSnake creates new snake

func (*Snake) Command

func (s *Snake) Command(cmd Command) error

func (*Snake) Die

func (s *Snake) Die()

func (*Snake) GetID

func (s *Snake) GetID() string

func (*Snake) GetLocation

func (s *Snake) GetLocation() engine.Location

func (*Snake) MarshalJSON

func (s *Snake) MarshalJSON() ([]byte, error)

func (*Snake) Run

func (s *Snake) Run(stop <-chan struct{}) <-chan struct{}

func (*Snake) String

func (s *Snake) String() string

Jump to

Keyboard shortcuts

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