diff --git a/backend/src/game/GameCrashManager.ts b/backend/src/game/GameCrashManager.ts index 45d8f19..1f76fe8 100644 --- a/backend/src/game/GameCrashManager.ts +++ b/backend/src/game/GameCrashManager.ts @@ -1,5 +1,6 @@ import fs from "fs"; -import { Game } from "../models/Game"; +import { Game } from "@mancala/core"; +import { BackendGame } from "../models/Game"; const crashFolder = "./crashes"; export class GameCrashManager { constructor() {} @@ -22,7 +23,7 @@ export class GameCrashManager { return `${year}-${month}-${date}-${hours}:${minutes}:${seconds}:${miliSeconds}`; } - public static logGameCrash(error: Error, game: Game): string { + public static logGameCrash(error: Error, game: BackendGame): string { this.createCrashFolderIfNotExist(); const crash = { message: error.message, diff --git a/backend/src/game/GameManager.ts b/backend/src/game/GameManager.ts index cc2aa98..2350240 100644 --- a/backend/src/game/GameManager.ts +++ b/backend/src/game/GameManager.ts @@ -15,10 +15,11 @@ import { channel_on_user_connection_change, channel_unlisten_game_events } from "@mancala/core"; -import { GameMove } from "../models/GameMove"; +import { GameMove } from "@mancala/core"; import { GameCrashManager } from "./GameCrashManager"; import { MatchMaker } from "../matchmaker/MatchMaker"; -import { Game, GameUsersConnectionInfo } from "../models/Game"; +import { GameUsersConnectionInfo } from "@mancala/core"; +import { BackendGame } from "../models/Game"; export class GameManager { gameStore: GameStore; @@ -82,7 +83,7 @@ export class GameManager { } } - private onGameError(game: Game, error: any) { + private onGameError(game: BackendGame, error: any) { console.error(error); const crashFileName = GameCrashManager.logGameCrash(error, game); console.info(`Game crash saved to file : ${crashFileName}`); @@ -118,18 +119,18 @@ export class GameManager { } } - private checkUserIdisPlayer(game: Game, userId: string): boolean { + private checkUserIdisPlayer(game: BackendGame, userId: string): boolean { return game.mancalaGame.player1Id === userId || game.mancalaGame.player2Id === userId; } - private sendMessageToPlayersAndSpectators(game: Game, channel: string, message: Object) { + private sendMessageToPlayersAndSpectators(game: BackendGame, channel: string, message: Object) { const sendMessage = (userId: string) => this.rtmt.sendMessage(userId, channel, message); sendMessage(game.mancalaGame.player1Id); sendMessage(game.mancalaGame.player2Id); game.spectatorIds.forEach((spectatorId) => sendMessage(spectatorId)); } - private onGameEnd(game: Game) { + private onGameEnd(game: BackendGame) { this.deleteGame(game); game.spectatorIds = []; } @@ -143,12 +144,12 @@ export class GameManager { public fireOnPlayerConnected(playerId: string) { } - public createMancalaGame(userKey1: string, userKey2: string): Game { + public createMancalaGame(userKey1: string, userKey2: string): BackendGame { const mancalaGame = new CommonMancalaGame(generateKey(), userKey1, userKey2); const random = Math.random(); mancalaGame.turnPlayerId = random > 0.5 ? userKey1 : userKey2; - const game: Game = { + const game: BackendGame = { id: mancalaGame.id, mancalaGame, gameUsersConnectionInfo: this.getGameUsersConnectionInfoFromUsers(mancalaGame.player1Id, mancalaGame.player2Id), @@ -161,7 +162,7 @@ export class GameManager { return game; } - public getGameUsersConnectionInfo(game: Game): GameUsersConnectionInfo { + public getGameUsersConnectionInfo(game: BackendGame): GameUsersConnectionInfo { return this.getGameUsersConnectionInfoFromUsers(game.mancalaGame.player1Id, game.mancalaGame.player2Id); } @@ -174,18 +175,18 @@ export class GameManager { }; } - public startGame(game: Game) { + public startGame(game: BackendGame) { this.sendMessageToPlayersAndSpectators(game, channel_on_game_start, game); this.sendUserConnectionInfo(game); this.sendUserConnectionInfo(game); } - public sendUserConnectionInfo(game: Game) { + public sendUserConnectionInfo(game: BackendGame) { const gameUsersConnectionInfo = this.getGameUsersConnectionInfo(game); this.sendMessageToPlayersAndSpectators(game, channel_on_user_connection_change, gameUsersConnectionInfo); } - public deleteGame(game: Game) { + public deleteGame(game: BackendGame) { if (game) { this.gameStore.removeGameByPlayer(game.mancalaGame.player1Id); this.gameStore.removeGameByPlayer(game.mancalaGame.player2Id); diff --git a/backend/src/game/gamestore/GameStore.ts b/backend/src/game/gamestore/GameStore.ts index 59c8ea3..3265e3c 100644 --- a/backend/src/game/gamestore/GameStore.ts +++ b/backend/src/game/gamestore/GameStore.ts @@ -1,16 +1,17 @@ -import { Game } from "../../models/Game"; +import { Game } from "@mancala/core"; +import { BackendGame } from "../../models/Game"; export interface GameStore { - get(id: string): Game | undefined; - set(id: string, game: Game): void; + get(id: string): BackendGame | undefined; + set(id: string, game: BackendGame): void; remove(id: string): void; setGameIdByUser(userId: string, gameId: string): void; getGameIdByUser(userId: string): string | undefined; removeGameIdByPlayer(userId: string): void; - setGameByUser(userId: string, game: Game): void; - getGameByUser(userId: string): Game | undefined; + setGameByUser(userId: string, game: BackendGame): void; + getGameByUser(userId: string): BackendGame | undefined; removeGameByPlayer(userId: string): void; getSpeactatingGameIdsByUser(userId: string): string[] diff --git a/backend/src/game/gamestore/GameStoreImpl.ts b/backend/src/game/gamestore/GameStoreImpl.ts index 218796b..d1153b9 100644 --- a/backend/src/game/gamestore/GameStoreImpl.ts +++ b/backend/src/game/gamestore/GameStoreImpl.ts @@ -1,14 +1,14 @@ -import { Game } from "../../models/Game"; import { GameStore } from "./GameStore"; +import { BackendGame } from "../../models/Game"; export class GameStoreImpl implements GameStore { - gameStore: Map = new Map() + gameStore: Map = new Map() userGameMap: Map = new Map() - get(id: string): Game | undefined { + get(id: string): BackendGame | undefined { return this.gameStore.get(id); } - set(id: string, game: Game): void { + set(id: string, game: BackendGame): void { this.gameStore.set(id, game); } remove(id: string): void { @@ -25,10 +25,10 @@ export class GameStoreImpl implements GameStore { this.userGameMap.delete(userId); } - setGameByUser(userId: string, game: Game): void { + setGameByUser(userId: string, game: BackendGame): void { this.setGameIdByUser(userId, game.id); } - getGameByUser(userId: string): Game | undefined { + getGameByUser(userId: string): BackendGame | undefined { const gameId = this.getGameIdByUser(userId); return gameId && this.gameStore.get(gameId) || undefined; } @@ -39,7 +39,7 @@ export class GameStoreImpl implements GameStore { getSpeactatingGameIdsByUser(userId: string): string[] { const speactatingGameIds = []; for (const gameId in this.gameStore.keys()) { - const game = this.gameStore.get(gameId) as Game; + const game = this.gameStore.get(gameId) as BackendGame; const isSpectator = game.spectatorIds.find((value) => value === userId); isSpectator && speactatingGameIds.push(game.id); } diff --git a/backend/src/models/Game.ts b/backend/src/models/Game.ts index 7a0d1db..01854f5 100644 --- a/backend/src/models/Game.ts +++ b/backend/src/models/Game.ts @@ -1,14 +1,5 @@ -import { MancalaGame } from "mancala.js"; -import { UserConnectionInfo } from "./UserConnectionInfo"; +import { Game } from "@mancala/core"; -export interface Game { - id: string; - mancalaGame: MancalaGame; - gameUsersConnectionInfo: GameUsersConnectionInfo; +export interface BackendGame extends Game { spectatorIds: string[]; -} - -export interface GameUsersConnectionInfo { - user1ConnectionInfo: UserConnectionInfo; - user2ConnectionInfo: UserConnectionInfo; } \ No newline at end of file diff --git a/core/package.json b/core/package.json index 30c8dc4..79aff9d 100644 --- a/core/package.json +++ b/core/package.json @@ -14,6 +14,9 @@ }, "author": "Halit Aksoy", "license": "MIT", + "dependencies": { + "mancala.js": "^0.0.2-beta.3" + }, "devDependencies": { "@types/jest": "^27.4.1", "@typescript-eslint/eslint-plugin": "^5.21.0", @@ -39,4 +42,4 @@ "url": "https://github.com/jhalitaksoy/mancala/issues" }, "homepage": "https://github.com/jhalitaksoy/mancala#readme" -} +} \ No newline at end of file diff --git a/core/src/index.ts b/core/src/index.ts index 771eeb7..2acaa4b 100644 --- a/core/src/index.ts +++ b/core/src/index.ts @@ -1 +1,2 @@ export * from './rtmt/channel_names' +export * from './models/index' \ No newline at end of file diff --git a/frontend/src/models/Game.ts b/core/src/models/Game.ts similarity index 100% rename from frontend/src/models/Game.ts rename to core/src/models/Game.ts diff --git a/backend/src/models/GameMove.ts b/core/src/models/GameMove.ts similarity index 100% rename from backend/src/models/GameMove.ts rename to core/src/models/GameMove.ts diff --git a/frontend/src/models/LoadingState.tsx b/core/src/models/LoadingState.ts similarity index 100% rename from frontend/src/models/LoadingState.tsx rename to core/src/models/LoadingState.ts diff --git a/backend/src/models/User.ts b/core/src/models/User.ts similarity index 100% rename from backend/src/models/User.ts rename to core/src/models/User.ts diff --git a/backend/src/models/UserConnectionInfo.ts b/core/src/models/UserConnectionInfo.ts similarity index 100% rename from backend/src/models/UserConnectionInfo.ts rename to core/src/models/UserConnectionInfo.ts diff --git a/core/src/models/index.ts b/core/src/models/index.ts new file mode 100644 index 0000000..d83e80d --- /dev/null +++ b/core/src/models/index.ts @@ -0,0 +1,5 @@ +export * from './Game' +export * from './GameMove' +export * from './LoadingState' +export * from './User' +export * from './UserConnectionInfo' \ No newline at end of file diff --git a/core/yarn.lock b/core/yarn.lock index 4547fe3..5944adf 100644 --- a/core/yarn.lock +++ b/core/yarn.lock @@ -2329,6 +2329,11 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +mancala.js@^0.0.2-beta.3: + version "0.0.2-beta.3" + resolved "https://registry.yarnpkg.com/mancala.js/-/mancala.js-0.0.2-beta.3.tgz#78edfa220e1a7172351a07f255eb81180845226a" + integrity sha512-LPmQ/VT4/JWFdp/YSB7k63zK7GyflApyh4M26t23a9uXFRSpBcWSePtNFpHU/xY2+1gVjlbOwQjup2QW3Tue7w== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" diff --git a/frontend/src/animation/PitAnimator.ts b/frontend/src/animation/PitAnimator.ts index ffcdf84..a07faf7 100644 --- a/frontend/src/animation/PitAnimator.ts +++ b/frontend/src/animation/PitAnimator.ts @@ -12,7 +12,7 @@ import { v4 } from "uuid"; import { Context } from "../context/context"; import BoardViewModelFactory from "../factory/BoardViewModelFactory"; import { PitViewModelFactory } from "../factory/PitViewModelFactory"; -import { Game } from "../models/Game"; +import { Game } from "@mancala/core"; import { Theme } from "../theme/Theme"; import { getColorByBrightness } from "../util/ColorUtil"; import BoardViewModel from "../viewmodel/BoardViewModel"; diff --git a/frontend/src/components/InfoPanel.tsx b/frontend/src/components/InfoPanel.tsx index c6071ed..72801b8 100644 --- a/frontend/src/components/InfoPanel.tsx +++ b/frontend/src/components/InfoPanel.tsx @@ -1,8 +1,7 @@ import * as React from "react"; import { FunctionComponent } from "react"; import { Context } from "../context/context"; -import { Game } from "../models/Game"; -import { User } from "../models/User"; +import { Game, User } from "@mancala/core"; import { getColorByBrightness } from "../util/ColorUtil"; import CircularPanel from "./CircularPanel"; diff --git a/frontend/src/components/LoadingComponent.tsx b/frontend/src/components/LoadingComponent.tsx index 3c9495e..5a11337 100644 --- a/frontend/src/components/LoadingComponent.tsx +++ b/frontend/src/components/LoadingComponent.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { FunctionComponent } from 'react'; import { Context } from '../context/context'; -import { LoadingState } from '../models/LoadingState'; +import { LoadingState } from "@mancala/core"; import { getColorByBrightness } from '../util/ColorUtil'; import CircularPanel from './CircularPanel'; diff --git a/frontend/src/components/UserStatus.tsx b/frontend/src/components/UserStatus.tsx index 82882ff..c5c0111 100644 --- a/frontend/src/components/UserStatus.tsx +++ b/frontend/src/components/UserStatus.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { FunctionComponent } from 'react'; import { Context } from '../context/context'; -import { User } from '../models/User'; +import { User } from "@mancala/core"; import { getColorByBrightness } from '../util/ColorUtil'; import Space from './Space'; diff --git a/frontend/src/components/board/BoardView.tsx b/frontend/src/components/board/BoardView.tsx index 29cf0dd..9c40e03 100644 --- a/frontend/src/components/board/BoardView.tsx +++ b/frontend/src/components/board/BoardView.tsx @@ -5,7 +5,7 @@ import BoardViewModel from "../../viewmodel/BoardViewModel"; import PitViewModel from "../../viewmodel/PitViewModel"; import PitView from "./PitView"; import StoreView from "./StoreView"; -import { Game } from "../../models/Game"; +import { Game } from "@mancala/core"; import { Pit } from "mancala.js"; const BoardView: FunctionComponent<{ diff --git a/frontend/src/models/GameMove.ts b/frontend/src/models/GameMove.ts deleted file mode 100644 index dcd22f5..0000000 --- a/frontend/src/models/GameMove.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface GameMove { - index: number; -} diff --git a/frontend/src/models/User.ts b/frontend/src/models/User.ts deleted file mode 100644 index e5ab1ae..0000000 --- a/frontend/src/models/User.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface User { - id: string; - name: string; - isOnline: boolean; - isAnonymous: boolean; -} \ No newline at end of file diff --git a/frontend/src/models/UserConnectionInfo.ts b/frontend/src/models/UserConnectionInfo.ts deleted file mode 100644 index 3ce426f..0000000 --- a/frontend/src/models/UserConnectionInfo.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface UserConnectionInfo { - userId: string; - isOnline: boolean; -} \ No newline at end of file diff --git a/frontend/src/routes/GamePage.tsx b/frontend/src/routes/GamePage.tsx index 7650f0c..beed2fc 100644 --- a/frontend/src/routes/GamePage.tsx +++ b/frontend/src/routes/GamePage.tsx @@ -20,13 +20,11 @@ import UserStatus from '../components/UserStatus'; import { channel_on_game_update, channel_on_game_crashed, channel_on_game_user_leave, channel_on_user_connection_change, channel_leave_game, channel_game_move, channel_listen_game_events, channel_unlisten_game_events } from '@mancala/core'; import { Context } from '../context/context'; import useWindowDimensions from '../hooks/useWindowDimensions'; -import { GameMove } from '../models/GameMove'; -import { LoadingState } from '../models/LoadingState'; +import { GameMove, LoadingState, Game, GameUsersConnectionInfo } from "@mancala/core"; import { Theme } from '../theme/Theme'; import { getColorByBrightness } from '../util/ColorUtil'; import BoardViewModel from '../viewmodel/BoardViewModel'; import Center from '../components/Center'; -import { Game, GameUsersConnectionInfo } from '../models/Game'; import notyf from '../util/Notyf'; import swal from 'sweetalert'; import Util from '../util/Util'; diff --git a/frontend/src/store/GameStore.ts b/frontend/src/store/GameStore.ts index fc30033..d4e62b0 100644 --- a/frontend/src/store/GameStore.ts +++ b/frontend/src/store/GameStore.ts @@ -1,5 +1,5 @@ -import { CommonMancalaGame, MancalaGame } from "mancala.js"; -import { Game } from "../models/Game"; +import { MancalaGame } from "mancala.js"; +import { Game } from "@mancala/core"; import { HttpService } from "../service/HttpService"; export interface GameStore { diff --git a/mobile/src/animation/PitAnimator.ts b/mobile/src/animation/PitAnimator.ts index 6238f68..054aa38 100644 --- a/mobile/src/animation/PitAnimator.ts +++ b/mobile/src/animation/PitAnimator.ts @@ -12,7 +12,7 @@ import { v4 } from "uuid"; import { Context } from "../context/context"; import BoardViewModelFactory from "../factory/BoardViewModelFactory"; import { PitViewModelFactory } from "../factory/PitViewModelFactory"; -import { Game } from "../models/Game"; +import { Game } from "@mancala/core"; import { Theme } from "../theme/Theme"; import { getColorByBrightness } from "../util/ColorUtil"; import BoardViewModel from "../viewmodel/BoardViewModel"; diff --git a/mobile/src/components/InfoPanel.tsx b/mobile/src/components/InfoPanel.tsx index 9f5cdb6..2aba88a 100644 --- a/mobile/src/components/InfoPanel.tsx +++ b/mobile/src/components/InfoPanel.tsx @@ -1,8 +1,7 @@ import * as React from "react"; import { FunctionComponent } from "react"; import { Context } from "../context/context"; -import { Game } from "../models/Game"; -import { User } from "../models/User"; +import { Game, User} from "@mancala/core"; import { getColorByBrightness } from "../util/ColorUtil"; import CircularPanel from "./CircularPanel"; import { useTranslation } from "react-i18next"; diff --git a/mobile/src/components/LoadingComponent.tsx b/mobile/src/components/LoadingComponent.tsx index 6d9d832..3275a15 100644 --- a/mobile/src/components/LoadingComponent.tsx +++ b/mobile/src/components/LoadingComponent.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { FunctionComponent } from 'react'; import { Context } from '../context/context'; -import { LoadingState } from '../models/LoadingState'; +import { LoadingState } from "@mancala/core"; import { getColorByBrightness } from '../util/ColorUtil'; import CircularPanel from './CircularPanel'; import { useTranslation } from 'react-i18next'; diff --git a/mobile/src/components/UserStatus.tsx b/mobile/src/components/UserStatus.tsx index 8ae2e9f..24d8e65 100644 --- a/mobile/src/components/UserStatus.tsx +++ b/mobile/src/components/UserStatus.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { FunctionComponent } from 'react'; import { Context } from '../context/context'; -import { User } from '../models/User'; +import { User } from "@mancala/core"; import { getColorByBrightness } from '../util/ColorUtil'; import Space from './Space'; import { Theme } from '../theme/Theme'; diff --git a/mobile/src/components/board/BoardView.tsx b/mobile/src/components/board/BoardView.tsx index 735d413..f1b25d9 100644 --- a/mobile/src/components/board/BoardView.tsx +++ b/mobile/src/components/board/BoardView.tsx @@ -5,7 +5,7 @@ import BoardViewModel from "../../viewmodel/BoardViewModel"; import PitViewModel from "../../viewmodel/PitViewModel"; import PitView from "./PitView"; import StoreView from "./StoreView"; -import { Game } from "../../models/Game"; +import { Game } from "@mancala/core"; import { Pit } from "mancala.js"; import { View, Dimensions } from "react-native"; import StoneView from "./StoneView"; diff --git a/mobile/src/models/Game.ts b/mobile/src/models/Game.ts deleted file mode 100644 index ec37311..0000000 --- a/mobile/src/models/Game.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MancalaGame } from "mancala.js"; -import { UserConnectionInfo } from "./UserConnectionInfo"; - -export interface Game { - id: string; - mancalaGame: MancalaGame; - gameUsersConnectionInfo: GameUsersConnectionInfo; -} - -export interface GameUsersConnectionInfo { - user1ConnectionInfo: UserConnectionInfo; - user2ConnectionInfo: UserConnectionInfo; -} \ No newline at end of file diff --git a/mobile/src/models/GameMove.ts b/mobile/src/models/GameMove.ts deleted file mode 100644 index dcd22f5..0000000 --- a/mobile/src/models/GameMove.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface GameMove { - index: number; -} diff --git a/mobile/src/models/LoadingState.tsx b/mobile/src/models/LoadingState.tsx deleted file mode 100644 index dfe1e4e..0000000 --- a/mobile/src/models/LoadingState.tsx +++ /dev/null @@ -1,46 +0,0 @@ -export type LoadingStateType = "unset" | "loading" | "loaded" | "error"; - -export class LoadingState { - state: LoadingStateType; - - errorMessage?: string; - - value?: T; - - constructor(props: { state?: LoadingStateType, errorMessage?: string, value?: T }) { - this.state = props.state ? props.state : "unset"; - this.errorMessage = props.errorMessage; - this.value = props.value; - } - - public static Unset() { - return new LoadingState({ state: "unset" }); - } - - public static Loading() { - return new LoadingState({ state: "loading" }); - } - - public static Error(props: { errorMessage: string }) { - const { errorMessage } = props; - return new LoadingState({ state: "error", errorMessage }); - } - - public static Loaded(props: { value?: T }) { - const { value } = props; - return new LoadingState({ state: "loaded", value }); - } - - public isUnset() : boolean { - return this.state === "unset"; - } - public isLoading() : boolean { - return this.state === "loading"; - } - public isError() : boolean { - return this.state === "error"; - } - public isLoaded() : boolean { - return this.state === "loaded"; - } -} \ No newline at end of file diff --git a/mobile/src/models/User.ts b/mobile/src/models/User.ts deleted file mode 100644 index e5ab1ae..0000000 --- a/mobile/src/models/User.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface User { - id: string; - name: string; - isOnline: boolean; - isAnonymous: boolean; -} \ No newline at end of file diff --git a/mobile/src/models/UserConnectionInfo.ts b/mobile/src/models/UserConnectionInfo.ts deleted file mode 100644 index 3ce426f..0000000 --- a/mobile/src/models/UserConnectionInfo.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface UserConnectionInfo { - userId: string; - isOnline: boolean; -} \ No newline at end of file diff --git a/mobile/src/screens/GameScreen.tsx b/mobile/src/screens/GameScreen.tsx index 6c6e681..6854011 100644 --- a/mobile/src/screens/GameScreen.tsx +++ b/mobile/src/screens/GameScreen.tsx @@ -3,14 +3,12 @@ import { View, Text, useWindowDimensions, Alert, Pressable } from 'react-native' import { useTranslation } from 'react-i18next'; import { GameScreenProps } from '../types'; import { useState } from 'react'; -import { Game, GameUsersConnectionInfo } from '../models/Game'; +import { Game, GameUsersConnectionInfo, GameMove, LoadingState } from "@mancala/core"; import BoardViewModel from '../viewmodel/BoardViewModel'; import { MancalaGame, Pit } from 'mancala.js'; import { v4 } from 'uuid'; import PitAnimator from '../animation/PitAnimator'; import { channel_on_game_update, channel_on_game_crashed, channel_on_game_user_leave, channel_on_user_connection_change, channel_listen_game_events, channel_unlisten_game_events, channel_leave_game, channel_game_move } from '@mancala/core'; -import { GameMove } from '../models/GameMove'; -import { LoadingState } from '../models/LoadingState'; import { getColorByBrightness } from '../util/ColorUtil'; import Util from '../util/Util'; import Snackbar from 'react-native-snackbar'; diff --git a/mobile/src/store/GameStore.ts b/mobile/src/store/GameStore.ts index fc30033..d4e62b0 100644 --- a/mobile/src/store/GameStore.ts +++ b/mobile/src/store/GameStore.ts @@ -1,5 +1,5 @@ -import { CommonMancalaGame, MancalaGame } from "mancala.js"; -import { Game } from "../models/Game"; +import { MancalaGame } from "mancala.js"; +import { Game } from "@mancala/core"; import { HttpService } from "../service/HttpService"; export interface GameStore {