Discover Packages
github.com/nosnaws/tiam
battlesnake
package
Version:
v0.0.0-...-4fb7718
Opens a new window with list of versions in this module.
Published: May 3, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Battlesnake struct {
ID string `json:"id"`
Name string `json:"name"`
Health int32 `json:"health"`
Body []Coord `json:"body"`
Head Coord `json:"head"`
Length int32 `json:"length"`
Latency string `json:"latency"`
Customizations Customizations `json:"customizations"`
Shout string `json:"shout"`
Squad string `json:"squad"`
}
type BattlesnakeInfoResponse struct {
APIVersion string `json:"apiversion"`
Author string `json:"author"`
Color string `json:"color"`
Head string `json:"head"`
Tail string `json:"tail"`
}
type BattlesnakeMoveResponse struct {
Move string `json:"move"`
Shout string `json:"shout,omitempty"`
}
type Board struct {
Height int `json:"height"`
Width int `json:"width"`
Food []Coord `json:"food"`
Snakes []Battlesnake `json:"snakes"`
Hazards []Coord `json:"hazards"`
}
type Coord struct {
X int `json:"x"`
Y int `json:"y"`
}
type Customizations struct {
Color string `json:"color"`
Head string `json:"head"`
Tail string `json:"tail"`
}
type Game struct {
ID string `json:"id"`
Ruleset Ruleset `json:"ruleset"`
Timeout int32 `json:"timeout"`
Map string `json:"map"`
Source string `json:"source"`
}
type GameState struct {
Game Game `json:"game"`
Turn int `json:"turn"`
Board Board `json:"board"`
You Battlesnake `json:"you"`
}
type Royale struct {
ShrinkEveryNTurns int32 `json:"shrinkEveryNTurns"`
}
type Ruleset struct {
Name string `json:"name"`
Version string `json:"version"`
Settings Settings `json:"settings"`
}
type Settings struct {
FoodSpawnChance int32 `json:"foodSpawnChance"`
MinimumFood int32 `json:"minimumFood"`
HazardDamagePerTurn int32 `json:"hazardDamagePerTurn"`
Royale Royale `json:"royale"`
Squad Squad `json:"squad"`
}
type Squad struct {
AllowBodyCollisions bool `json:"allowBodyCollisions"`
SharedElimination bool `json:"sharedElimination"`
SharedHealth bool `json:"sharedHealth"`
SharedLength bool `json:"sharedLength"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.