(misc): reindented file with tabs
This commit is contained in:
parent
014ab9fa70
commit
7fe19d1737
1 changed files with 24 additions and 25 deletions
|
|
@ -1,31 +1,30 @@
|
|||
import { isNullish } from '@shared/utils';
|
||||
import type { Database } from './_base';
|
||||
import { UserId } from './user';
|
||||
// import { UserId } from './user';
|
||||
|
||||
// describe every function in the object
|
||||
export interface ITicTacToeDb extends Database {
|
||||
normalFunction(id: TemplateId): TemplateData | undefined,
|
||||
asyncFunction(id: TemplateId): Promise<TemplateData | undefined>,
|
||||
normalFunction(id: TemplateId): TemplateData | undefined,
|
||||
asyncFunction(id: TemplateId): Promise<TemplateData | undefined>,
|
||||
};
|
||||
|
||||
export const TicTacToeImpl: Omit<ITicTacToeDb, keyof Database> = {
|
||||
/**
|
||||
* @brief Write the outcome of the specified game to the database.
|
||||
*
|
||||
* @param gameId The game we want to write the outcome of.
|
||||
*
|
||||
*/
|
||||
setGameOutcome(this: ITicTacToeDb, id: GameId): void {
|
||||
// Find a way to retrieve the outcome of the game.
|
||||
this.prepare('INSERT INTO tictactoe (game, outcome) VALUES (@id, "draw" /* replace w/ game outcome */)').run({ id });
|
||||
},
|
||||
/**
|
||||
* whole function description
|
||||
*
|
||||
* @param id the argument description
|
||||
*
|
||||
* @returns what does the function return ?
|
||||
*/
|
||||
/**
|
||||
* @brief Write the outcome of the specified game to the database.
|
||||
*
|
||||
* @param gameId The game we want to write the outcome of.
|
||||
*
|
||||
*/
|
||||
setGameOutcome(this: ITicTacToeDb, id: GameId): void {
|
||||
// Find a way to retrieve the outcome of the game.
|
||||
this.prepare('INSERT INTO tictactoe (game, outcome) VALUES (@id, "draw" /* replace w/ game outcome */)').run({ id });
|
||||
},
|
||||
/**
|
||||
* whole function description
|
||||
*
|
||||
* @param id the argument description
|
||||
*
|
||||
* @returns what does the function return ?
|
||||
*/
|
||||
// async asyncFunction(this: ITemplateDb, id: TemplateId): Promise<TemplateData | undefined> {
|
||||
// void id;
|
||||
// return undefined;
|
||||
|
|
@ -35,10 +34,10 @@ export const TicTacToeImpl: Omit<ITicTacToeDb, keyof Database> = {
|
|||
export type TicTacToeId = number & { readonly __brand: unique symbol };
|
||||
|
||||
export type TemplateData = {
|
||||
readonly id: TicTacToeId;
|
||||
readonly player1: string;
|
||||
readonly player2: string;
|
||||
readonly outcome: string;
|
||||
readonly id: TicTacToeId;
|
||||
readonly player1: string;
|
||||
readonly player2: string;
|
||||
readonly outcome: string;
|
||||
};
|
||||
|
||||
// this function will be able to be called from everywhere
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue