Documentation ¶
Index ¶
- func Encode(game *ViewGame, buf *bytes.Buffer) error
- type MoveBattlesnake
- type MoveBattlesnakeResponse
- type MoveBoard
- type MoveCoord
- type MoveGame
- type MoveGameState
- type MoveRoyale
- type MoveRuleset
- type MoveSettings
- type MoveSquad
- type ViewCoord
- type ViewDeath
- type ViewFrame
- type ViewGame
- type ViewGameResponse
- type ViewGameSettings
- type ViewRuleset
- type ViewSnake
- type ViewTurn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MoveBattlesnake ¶
type MoveBattlesnakeResponse ¶
type MoveBoard ¶
type MoveBoard struct { Height int32 `json:"height"` Width int32 `json:"width"` Food []MoveCoord `json:"food"` Snakes []MoveBattlesnake `json:"snakes"` Hazards []MoveCoord `json:"hazards"` }
type MoveGame ¶
type MoveGame struct { ID string `json:"id"` Ruleset MoveRuleset `json:"ruleset"` Timeout int32 `json:"timeout"` }
type MoveGameState ¶
type MoveGameState struct { Game MoveGame `json:"game"` Turn int32 `json:"turn"` Board MoveBoard `json:"board"` You MoveBattlesnake `json:"you"` }
type MoveRoyale ¶
type MoveRoyale struct {
ShrinkEveryNTurns int32 `json:"shrinkEveryNTurns"`
}
type MoveRuleset ¶
type MoveRuleset struct { Name string `json:"name"` Version string `json:"version"` Settings MoveSettings `json:"settings"` }
type MoveSettings ¶
type MoveSettings struct { FoodSpawnChance int32 `json:"foodSpawnChance"` MinimumFood int32 `json:"minimumFood"` HazardDamagePerTurn int32 `json:"hazardDamagePerTurn"` Royale MoveRoyale `json:"royale"` Squad MoveSquad `json:"squad"` }
type ViewGame ¶
type ViewGame struct { Game ViewGameSettings `json:"Game"` Frames []ViewFrame `json:"Frames"` FirstFrame ViewFrame `json:"FirstFrame"` LastTurn int32 `json:"LastTurn"` }
type ViewGameResponse ¶
type ViewGameResponse struct {
Game ViewGameSettings `json:"Game"`
}
type ViewGameSettings ¶
type ViewRuleset ¶
type ViewSnake ¶
type ViewSnake struct { ID string `json:"ID"` Name string `json:"Name"` URL string `json:"URL"` Body []ViewCoord `json:"Body"` Health int32 `json:"Health"` Color string `json:"Color"` HeadType string `json:"HeadType"` TailType string `json:"TailType"` Latency string `json:"Latency"` Shout string `json:"Shout"` Squad string `json:"Squad"` APIVersion string `json:"APIVersion"` Author string `json:"Author"` Death ViewDeath `json:"Death,omitempty"` }
Click to show internal directories.
Click to hide internal directories.