lafkob / swe681_game

Our game for SWE 681.
0 stars 1 forks source link

Persist statistics in database #19

Closed StormGull closed 8 years ago

StormGull commented 8 years ago

This is the win/loss/draw record each player needs to have. I started it off by setting up the SQL table format, but need to make the DAO and model. I can follow your examples and put that together. We need to trigger an update of this when one player makes a winning move and gets back a "win" response.

lafkob commented 8 years ago

For this, what if we just record a winner_id in the games table? The game board might already provide this via a getter?

We also need to think about how a loser quits/loses a game. For a quit, we don't want to remove them from the board. Basically, the game would end and indicate that the other player won. We might want another status for a game FORFEIT - which with the winner id would indicate the other user id quit the game.

lafkob commented 8 years ago

Closing this, we are able to grab the win, loss statistics from the games table via the REST endpoint /api/info/users.