snake

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: 11 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 ffjson: skip

func NewSnake

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

NewSnake creates new snake

func (*Snake) Command

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

func (*Snake) GetID

func (s *Snake) GetID() world.Identifier

func (*Snake) GetLocation

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

func (*Snake) Hit

func (s *Snake) Hit(dot engine.Dot, force float64) (success bool, err error)

func (*Snake) MarshalJSON

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

func (*Snake) Run

func (s *Snake) Run(stop <-chan struct{}, logger logrus.FieldLogger) <-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