diff options
Diffstat (limited to 'client/src/gameState.ts')
| -rw-r--r-- | client/src/gameState.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/client/src/gameState.ts b/client/src/gameState.ts new file mode 100644 index 0000000..b276136 --- /dev/null +++ b/client/src/gameState.ts @@ -0,0 +1,27 @@ + +export interface GameState { + players: [ Player, Player ]; // a player array contains exactly two Players + gameStatus: { + endOfGame: boolean; + }; +} + +interface Player { + name: string; + pits: Pit[]; + type: "player1" | "player2"; // only "player1" and "player2" are valid options for this string + hasTurn: boolean; +} + +interface Pit { + index: number; + nrOfStones: number; + state: PitState; + setPitState: (newPitState: PitState) => void; +} + + +interface PitState { + stoneElements: JSX.Element[] | undefined; + } + |
