Skip to content

Commit

Permalink
Save game in play.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bcollazo committed Oct 4, 2020
1 parent 64f91d7 commit a7bd6d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def get_finished_games_ids():


def get_game_states(game_id):
cursor.execute(SELECT_STATES_QUERY, (game_id))
cursor.execute(SELECT_STATES_QUERY, (game_id,))
row = cursor.fetchone()
while row is not None:
pickle_data = row[2]
pickle_data = row[4]
game = pickle.loads(pickle_data)
yield game
row = cursor.fetchone()
1 change: 1 addition & 0 deletions play.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
],
)
game.play()
save_game_state(game)
print({p.color.value: p.actual_victory_points for p in game.players})
print("See result at http://localhost:3000/games/" + game.id)

0 comments on commit a7bd6d2

Please sign in to comment.