store what snake win the game
This commit is contained in:
+2
-1
@@ -94,9 +94,10 @@ class Server:
|
||||
def _end(self, game_state:dict):
|
||||
if self.store_game_state:
|
||||
self.game_state_storage.add_end_state(game_state["board"], self.snake.get_history())
|
||||
self.game_state_storage.set_winner_snake_name(game_state["board"]['snakes'])
|
||||
self.game_state_storage.save(
|
||||
f"{self.snake.__class__.__name__}_{datetime.now().strftime('%d.%m.%Y_%H%M%S')}_{game_state['game']['id']}.json",
|
||||
callback=json.dump, indent=2, ensure_ascii=False
|
||||
)
|
||||
|
||||
print("GAME OVER\n")
|
||||
print("GAME OVER:\n- Winner is", [ x["name"] for x in game_state["board"]['snakes']])
|
||||
|
||||
Reference in New Issue
Block a user