diff --git a/src/game/gamestore/GameStore.ts b/src/game/gamestore/GameStore.ts new file mode 100644 index 0000000..97d3f8e --- /dev/null +++ b/src/game/gamestore/GameStore.ts @@ -0,0 +1,7 @@ +import { MancalaGame } from "mancala.js"; + +export interface GameStore { + get(id: string): MancalaGame | undefined; + set(id: string, game: MancalaGame): void; + remove(id: string): void; +} \ No newline at end of file diff --git a/src/game/gamestore/GameStoreImpl.ts b/src/game/gamestore/GameStoreImpl.ts new file mode 100644 index 0000000..9256485 --- /dev/null +++ b/src/game/gamestore/GameStoreImpl.ts @@ -0,0 +1,16 @@ +import { MancalaGame } from "mancala.js"; +import { GameStore } from "./GameStore"; + +export class GameStoreImpl implements GameStore { + gameStore: Map = new Map() + + get(id: string): MancalaGame | undefined { + return this.gameStore.get(id); + } + set(id: string, game: MancalaGame): void { + this.gameStore.set(id, game); + } + remove(id: string): void { + this.gameStore.delete(id); + } +} \ No newline at end of file