From 838386d1e69ec63e17f10ff122b60cb50072b35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D1=80=D0=B0=D0=BC=D1=8B=D1=86=D0=BA=D0=B8=D1=85=20?= =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Sun, 20 Aug 2023 22:26:29 +0500 Subject: [PATCH] feat: changed types to interfaces | added gameType | import FinishedGameState | import PlayerI | import TGameType #190 --- contexts/GameStateContext.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/contexts/GameStateContext.tsx b/contexts/GameStateContext.tsx index fa7a816..8b97c98 100644 --- a/contexts/GameStateContext.tsx +++ b/contexts/GameStateContext.tsx @@ -11,6 +11,9 @@ // // console.log('FINISH GameResult FinishedGameState', FinishedGameState) // // console.log('FINISH GameResult finishGameCheckResult', finishGameCheckResult); +import {PlayerI, TGameType} from 'types/game'; +import {FinishedGameState} from "../gameApi"; + export const GameStateContextDefault: GameStateType = { finishGameCheckResult: null, finishedGameState: null, @@ -20,17 +23,21 @@ export const GameStateContextDefault: GameStateType = { isDraw: false, disqualified: null, resigned: null, + players: null, + }; -export type GameStateType = { - finishGameCheckResult: null; - finishedGameState: null; +export interface GameStateType { + finishGameCheckResult: null | { winner: boolean; isDraw: boolean; cheatWin: boolean }; + finishedGameState: FinishedGameState | null; gameId: number; winner: string | null; loser: string | null; isDraw: boolean; disqualified: string | null; resigned: string | null; + players: PlayerI[] | null; + gameType?: TGameType; };