@@ -15,9 +15,9 @@ class State(JSONSerializable):
15
15
tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y]
16
16
tick: The current game tick
17
17
is_finished: whether or not the game is finished
18
- players: A dict with all players in the game. The keys are the player ids
19
- bombs: A dict with all bombs in the game. The keys are the bomb ids
20
- bonuses: A dict with all bonuses in the game. The keys are the bonus ids
18
+ players: A list with all players in the game
19
+ bombs: A list with all bombs in the game
20
+ bonuses: A list with all bonuses in the game
21
21
width: The width of the map
22
22
height: The height of the map
23
23
sudden_death_countdown: When the sudden death countdown reaches 0, the sudden death starts
@@ -36,9 +36,9 @@ def __init__(self, state_string, current_player_id):
36
36
37
37
self .tick = json_state ["tick" ]
38
38
self .is_finished = json_state ["isFinished" ]
39
- self .players = [Player (player_json ) for _ , player_json in json_state ["players" ].items ()]
40
- self .bombs = [Bomb (bomb_json ) for _ , bomb_json in json_state ["bombs" ].items ()]
41
- self .bonuses = [Bonus (bonus_json ) for _ , bonus_json in json_state ["bonuses" ].items ()]
39
+ self .players = [Player (player_json ) for player_json in json_state ["players" ].values ()]
40
+ self .bombs = [Bomb (bomb_json ) for bomb_json in json_state ["bombs" ].values ()]
41
+ self .bonuses = [Bonus (bonus_json ) for bonus_json in json_state ["bonuses" ].values ()]
42
42
self .width = json_state ["width" ]
43
43
self .height = json_state ["height" ]
44
44
self .sudden_death_countdown = json_state ["suddenDeathCountdown" ]
0 commit comments