mancala/src/game/gamestore/GameStoreImpl.ts

16 lines
464 B
TypeScript
Raw Normal View History

2022-07-15 21:42:38 +03:00
import { MancalaGame } from "mancala.js";
import { GameStore } from "./GameStore";
export class GameStoreImpl implements GameStore {
gameStore: Map<string, MancalaGame> = new Map<string, MancalaGame>()
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);
}
}