commands

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Battlesnakes map[string]Battlesnake
View Source
var GameId string
View Source
var GameType string
View Source
var Height int32
View Source
var HttpClient http.Client
View Source
var Names []string
View Source
var Seed int64
View Source
var Sequential bool
View Source
var Squads []string
View Source
var Timeout int32
View Source
var Turn int32
View Source
var URLs []string
View Source
var ViewMap bool
View Source
var Width int32

Functions

func Execute

func Execute()

Types

type Battlesnake

type Battlesnake struct {
	URL       string
	Name      string
	ID        string
	API       string
	LastMove  string
	Squad     string
	Character rune
}

type BoardResponse

type BoardResponse struct {
	Height  int32           `json:"height"`
	Width   int32           `json:"width"`
	Food    []Coord         `json:"food"`
	Hazards []Coord         `json:"hazards"`
	Snakes  []SnakeResponse `json:"snakes"`
}

type Coord

type Coord struct {
	X int32 `json:"x"`
	Y int32 `json:"y"`
}

type GameResponse

type GameResponse struct {
	Id      string `json:"id"`
	Timeout int32  `json:"timeout"`
}

type PingResponse

type PingResponse struct {
	APIVersion string `json:"apiversion"`
	Author     string `json:"author"`
	Color      string `json:"color"`
	Head       string `json:"head"`
	Tail       string `json:"tail"`
	Version    string `json:"version"`
}

type PlayerResponse

type PlayerResponse struct {
	Move  string `json:"move"`
	Shout string `json:"shout"`
}

type ResponsePayload

type ResponsePayload struct {
	Game  GameResponse  `json:"game"`
	Turn  int32         `json:"turn"`
	Board BoardResponse `json:"board"`
	You   SnakeResponse `json:"you"`
}

type SnakeResponse

type SnakeResponse struct {
	Id      string  `json:"id"`
	Name    string  `json:"name"`
	Health  int32   `json:"health"`
	Body    []Coord `json:"body"`
	Latency int32   `json:"latency"`
	Head    Coord   `json:"head"`
	Length  int32   `json:"length"`
	Shout   string  `json:"shout"`
	Squad   string  `json:"squad"`
}

Jump to

Keyboard shortcuts

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