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