Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board struct {
Height int32 `json:"height"`
Width int32 `json:"width"`
Snakes []Snake `json:"snakes"`
Food []Coord `json:"food"`
Hazards []Coord `json:"hazards"`
}
Board provides information about the game board
type Customizations ¶
type Game ¶
type Game struct {
ID string `json:"id"`
Ruleset Ruleset `json:"ruleset"`
Timeout int32 `json:"timeout"`
Source string `json:"source"`
}
Game represents the current game state
type MoveResponse ¶
The expected format of the response body from a /move request
type RoyaleSettings ¶
type RoyaleSettings rules.RoyaleSettings
RoyaleSettings is deprecated: use rules.RoyaleSettings instead
type RulesetSettings ¶
RulesetSettings is deprecated: use rules.Settings instead
type Snake ¶
type Snake struct {
ID string `json:"id"`
Name string `json:"name"`
Latency string `json:"latency"`
Health int32 `json:"health"`
Body []Coord `json:"body"`
Head Coord `json:"head"`
Length int32 `json:"length"`
Shout string `json:"shout"`
Squad string `json:"squad"`
Customizations Customizations `json:"customizations"`
}
Snake represents information about a snake in the game
type SnakeMetadataResponse ¶
type SnakeMetadataResponse struct {
APIVersion string `json:"apiversion,omitempty"`
Author string `json:"author,omitempty"`
Color string `json:"color,omitempty"`
Head string `json:"head,omitempty"`
Tail string `json:"tail,omitempty"`
Version string `json:"version,omitempty"`
}
The expected format of the response body from a GET request to a Battlesnake's index URL
type SnakeRequest ¶
type SnakeRequest struct {
Game Game `json:"game"`
Turn int32 `json:"turn"`
Board Board `json:"board"`
You Snake `json:"you"`
}
The top-level message sent in /start, /move, and /end requests
type SquadSettings ¶
type SquadSettings rules.SquadSettings
SquadSettings is deprecated: use rules.SquadSettings instead
Click to show internal directories.
Click to hide internal directories.