add map to snake request body (#73)
This commit is contained in:
parent
e94d758a9b
commit
2d8342018e
11 changed files with 106 additions and 95 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,108 +1,109 @@
|
||||||
{
|
{
|
||||||
"game": {
|
"game": {
|
||||||
"id": "",
|
"id": "",
|
||||||
"ruleset": {
|
"ruleset": {
|
||||||
"name": "constrictor",
|
"name": "constrictor",
|
||||||
"version": "cli",
|
"version": "cli",
|
||||||
"settings": {
|
"settings": {
|
||||||
"foodSpawnChance": 11,
|
"foodSpawnChance": 11,
|
||||||
"minimumFood": 7,
|
"minimumFood": 7,
|
||||||
"hazardDamagePerTurn": 19,
|
"hazardDamagePerTurn": 19,
|
||||||
"hazardMap": "hz_spiral",
|
"hazardMap": "hz_spiral",
|
||||||
"hazardMapAuthor": "altersaddle",
|
"hazardMapAuthor": "altersaddle",
|
||||||
"royale": {
|
"royale": {
|
||||||
"shrinkEveryNTurns": 0
|
"shrinkEveryNTurns": 0
|
||||||
},
|
},
|
||||||
"squad": {
|
"squad": {
|
||||||
"allowBodyCollisions": false,
|
"allowBodyCollisions": false,
|
||||||
"sharedElimination": false,
|
"sharedElimination": false,
|
||||||
"sharedHealth": false,
|
"sharedHealth": false,
|
||||||
"sharedLength": false
|
"sharedLength": false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"timeout": 500,
|
|
||||||
"source": ""
|
|
||||||
},
|
},
|
||||||
"turn": 0,
|
"map": "",
|
||||||
"board": {
|
"timeout": 500,
|
||||||
"height": 11,
|
"source": ""
|
||||||
"width": 11,
|
},
|
||||||
"snakes": [
|
"turn": 0,
|
||||||
{
|
"board": {
|
||||||
"id": "one",
|
"height": 11,
|
||||||
"name": "ONE",
|
"width": 11,
|
||||||
"latency": "0",
|
"snakes": [
|
||||||
"health": 0,
|
{
|
||||||
"body": [
|
"id": "one",
|
||||||
{
|
"name": "ONE",
|
||||||
"x": 3,
|
"latency": "0",
|
||||||
"y": 3
|
"health": 0,
|
||||||
}
|
"body": [
|
||||||
],
|
{
|
||||||
"head": {
|
|
||||||
"x": 3,
|
"x": 3,
|
||||||
"y": 3
|
"y": 3
|
||||||
},
|
|
||||||
"length": 1,
|
|
||||||
"shout": "",
|
|
||||||
"squad": "",
|
|
||||||
"customizations": {
|
|
||||||
"color": "#123456",
|
|
||||||
"head": "safe",
|
|
||||||
"tail": "curled"
|
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
{
|
"head": {
|
||||||
"id": "two",
|
|
||||||
"name": "TWO",
|
|
||||||
"latency": "0",
|
|
||||||
"health": 0,
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"x": 4,
|
|
||||||
"y": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"head": {
|
|
||||||
"x": 4,
|
|
||||||
"y": 3
|
|
||||||
},
|
|
||||||
"length": 1,
|
|
||||||
"shout": "",
|
|
||||||
"squad": "",
|
|
||||||
"customizations": {
|
|
||||||
"color": "#654321",
|
|
||||||
"head": "silly",
|
|
||||||
"tail": "bolt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"food": [],
|
|
||||||
"hazards": []
|
|
||||||
},
|
|
||||||
"you": {
|
|
||||||
"id": "one",
|
|
||||||
"name": "ONE",
|
|
||||||
"latency": "0",
|
|
||||||
"health": 0,
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"x": 3,
|
"x": 3,
|
||||||
"y": 3
|
"y": 3
|
||||||
|
},
|
||||||
|
"length": 1,
|
||||||
|
"shout": "",
|
||||||
|
"squad": "",
|
||||||
|
"customizations": {
|
||||||
|
"color": "#123456",
|
||||||
|
"head": "safe",
|
||||||
|
"tail": "curled"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
"head": {
|
{
|
||||||
|
"id": "two",
|
||||||
|
"name": "TWO",
|
||||||
|
"latency": "0",
|
||||||
|
"health": 0,
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"x": 4,
|
||||||
|
"y": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"head": {
|
||||||
|
"x": 4,
|
||||||
|
"y": 3
|
||||||
|
},
|
||||||
|
"length": 1,
|
||||||
|
"shout": "",
|
||||||
|
"squad": "",
|
||||||
|
"customizations": {
|
||||||
|
"color": "#654321",
|
||||||
|
"head": "silly",
|
||||||
|
"tail": "bolt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"food": [],
|
||||||
|
"hazards": []
|
||||||
|
},
|
||||||
|
"you": {
|
||||||
|
"id": "one",
|
||||||
|
"name": "ONE",
|
||||||
|
"latency": "0",
|
||||||
|
"health": 0,
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
"x": 3,
|
"x": 3,
|
||||||
"y": 3
|
"y": 3
|
||||||
},
|
|
||||||
"length": 1,
|
|
||||||
"shout": "",
|
|
||||||
"squad": "",
|
|
||||||
"customizations": {
|
|
||||||
"color": "#123456",
|
|
||||||
"head": "safe",
|
|
||||||
"tail": "curled"
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"head": {
|
||||||
|
"x": 3,
|
||||||
|
"y": 3
|
||||||
|
},
|
||||||
|
"length": 1,
|
||||||
|
"shout": "",
|
||||||
|
"squad": "",
|
||||||
|
"customizations": {
|
||||||
|
"color": "#123456",
|
||||||
|
"head": "safe",
|
||||||
|
"tail": "curled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "",
|
||||||
"timeout": 500,
|
"timeout": 500,
|
||||||
"source": ""
|
"source": ""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ func exampleSnakeRequest() SnakeRequest {
|
||||||
},
|
},
|
||||||
Timeout: 33,
|
Timeout: 33,
|
||||||
Source: "league",
|
Source: "league",
|
||||||
|
Map: "standard",
|
||||||
},
|
},
|
||||||
Turn: 11,
|
Turn: 11,
|
||||||
Board: Board{
|
Board: Board{
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ type SnakeRequest struct {
|
||||||
type Game struct {
|
type Game struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Ruleset Ruleset `json:"ruleset"`
|
Ruleset Ruleset `json:"ruleset"`
|
||||||
|
Map string `json:"map"`
|
||||||
Timeout int32 `json:"timeout"`
|
Timeout int32 `json:"timeout"`
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
client/testdata/snake_request.json
vendored
1
client/testdata/snake_request.json
vendored
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "standard",
|
||||||
"timeout": 33,
|
"timeout": 33,
|
||||||
"source": "league"
|
"source": "league"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"map": "standard",
|
||||||
"timeout": 33,
|
"timeout": 33,
|
||||||
"source": "league"
|
"source": "league"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue