DEV 559: Refactor CLI and add customizations (#57)
* move snake API structs into a new client package * add customizations to snake objects * refactor and add support for passing snake customizations in games
This commit is contained in:
parent
6140f232c2
commit
4a9dbbcaef
10 changed files with 665 additions and 197 deletions
46
cli/commands/testdata/snake_request_body.json
vendored
46
cli/commands/testdata/snake_request_body.json
vendored
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
"game": {
|
||||
"id": "",
|
||||
"timeout": 500,
|
||||
"ruleset": {
|
||||
"name": "standard",
|
||||
"version": "cli",
|
||||
"settings": {
|
||||
"hazardDamagePerTurn": 14,
|
||||
"foodSpawnChance": 15,
|
||||
"minimumFood": 1,
|
||||
"hazardDamagePerTurn": 14,
|
||||
"royale": {
|
||||
"shrinkEveryNTurns": 25
|
||||
},
|
||||
|
|
@ -19,18 +18,19 @@
|
|||
"sharedLength": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"timeout": 500,
|
||||
"source": ""
|
||||
},
|
||||
"turn": 0,
|
||||
"board": {
|
||||
"height": 11,
|
||||
"width": 11,
|
||||
"food": [],
|
||||
"hazards": [],
|
||||
"snakes": [
|
||||
{
|
||||
"id": "one",
|
||||
"name": "",
|
||||
"name": "ONE",
|
||||
"latency": "0",
|
||||
"health": 0,
|
||||
"body": [
|
||||
{
|
||||
|
|
@ -38,18 +38,23 @@
|
|||
"y": 3
|
||||
}
|
||||
],
|
||||
"latency": "0",
|
||||
"head": {
|
||||
"x": 3,
|
||||
"y": 3
|
||||
},
|
||||
"length": 1,
|
||||
"shout": "",
|
||||
"squad": ""
|
||||
"squad": "",
|
||||
"customizations": {
|
||||
"color": "#123456",
|
||||
"head": "safe",
|
||||
"tail": "curled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "two",
|
||||
"name": "",
|
||||
"name": "TWO",
|
||||
"latency": "0",
|
||||
"health": 0,
|
||||
"body": [
|
||||
{
|
||||
|
|
@ -57,20 +62,27 @@
|
|||
"y": 3
|
||||
}
|
||||
],
|
||||
"latency": "0",
|
||||
"head": {
|
||||
"x": 4,
|
||||
"y": 3
|
||||
},
|
||||
"length": 1,
|
||||
"shout": "",
|
||||
"squad": ""
|
||||
"squad": "",
|
||||
"customizations": {
|
||||
"color": "#654321",
|
||||
"head": "silly",
|
||||
"tail": "bolt"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"food": [],
|
||||
"hazards": []
|
||||
},
|
||||
"you": {
|
||||
"id": "one",
|
||||
"name": "",
|
||||
"name": "ONE",
|
||||
"latency": "0",
|
||||
"health": 0,
|
||||
"body": [
|
||||
{
|
||||
|
|
@ -78,13 +90,17 @@
|
|||
"y": 3
|
||||
}
|
||||
],
|
||||
"latency": "0",
|
||||
"head": {
|
||||
"x": 3,
|
||||
"y": 3
|
||||
},
|
||||
"length": 1,
|
||||
"shout": "",
|
||||
"squad": ""
|
||||
"squad": "",
|
||||
"customizations": {
|
||||
"color": "#123456",
|
||||
"head": "safe",
|
||||
"tail": "curled"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue