DEV 1916: Fix output issues in CLI (#114)

* adding testing of output file and write line for /end

* fix regression in latency rounding for board
This commit is contained in:
Rob O'Dwyer 2022-10-20 13:16:52 -07:00 committed by GitHub
parent 5f60ccbba8
commit 639362ef46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 396 additions and 49 deletions

110
cli/commands/testdata/jsonl_turn_0.json vendored Normal file
View file

@ -0,0 +1,110 @@
{
"game": {
"id": "GAME_ID",
"ruleset": {
"name": "standard",
"version": "cli",
"settings": {
"foodSpawnChance": 1,
"minimumFood": 2,
"hazardDamagePerTurn": 3,
"hazardMap": "",
"hazardMapAuthor": "",
"royale": {
"shrinkEveryNTurns": 4
},
"squad": {
"allowBodyCollisions": false,
"sharedElimination": false,
"sharedHealth": false,
"sharedLength": false
}
}
},
"map": "standard",
"timeout": 500,
"source": ""
},
"turn": 0,
"board": {
"height": 11,
"width": 11,
"snakes": [
{
"id": "snk_0",
"name": "example snake",
"latency": "0",
"health": 100,
"body": [
{
"x": 1,
"y": 5
},
{
"x": 1,
"y": 5
},
{
"x": 1,
"y": 5
}
],
"head": {
"x": 1,
"y": 5
},
"length": 3,
"shout": "",
"squad": "",
"customizations": {
"color": "#123456",
"head": "safe",
"tail": "curled"
}
}
],
"food": [
{
"x": 0,
"y": 4
},
{
"x": 5,
"y": 5
}
],
"hazards": []
},
"you": {
"id": "snk_0",
"name": "example snake",
"latency": "0",
"health": 100,
"body": [
{
"x": 1,
"y": 5
},
{
"x": 1,
"y": 5
},
{
"x": 1,
"y": 5
}
],
"head": {
"x": 1,
"y": 5
},
"length": 3,
"shout": "",
"squad": "",
"customizations": {
"color": "#123456",
"head": "safe",
"tail": "curled"
}
}
}