(tic-tac-toe): Extended setGameOutcome to include player details in database insertion
This commit is contained in:
parent
39f71bb4d9
commit
fb6566fac9
1 changed files with 2 additions and 2 deletions
|
|
@ -14,9 +14,9 @@ export const TicTacToeImpl: Omit<ITicTacToeDb, keyof Database> = {
|
||||||
* @param gameId The game we want to write the outcome of.
|
* @param gameId The game we want to write the outcome of.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
setGameOutcome(this: ITicTacToeDb, id: GameId, outcome: string): void {
|
setGameOutcome(this: ITicTacToeDb, id: GameId, player1: string, player2: string, outcome: string): void {
|
||||||
// Find a way to retrieve the outcome of the game.
|
// Find a way to retrieve the outcome of the game.
|
||||||
this.prepare('INSERT INTO tictactoe (game, outcome) VALUES (@id, @outcome)').run({ id });
|
this.prepare('INSERT INTO tictactoe (id, player1, player2, outcome) VALUES (@id, @player1, @player2, @outcome)').run({ id, player1, player2, outcome });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* whole function description
|
* whole function description
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue