diff --git a/bob_party/src/components/GameComponent.tsx b/bob_party/src/components/GameComponent.tsx index 3cd9ae4..a5134d9 100644 --- a/bob_party/src/components/GameComponent.tsx +++ b/bob_party/src/components/GameComponent.tsx @@ -9,6 +9,9 @@ import { Game } from "../core/game" */ import styles from './style/Game.style'; import LobbySolo from "../screens/LobbySolo" +import ManagerMatch from "../services/matchServices/managerMatch" +import MatchCreator from "../core/Match/matchCreator" +import { MANAGER_USER } from "../../App" export const GameComponent : /* @@ -33,7 +36,10 @@ FC<{game: Game, nav: any}> = } function createNewMatchSolo(game : Game, nav: any) { - - - nav.navigate("LobbySolo") + const m=new MatchCreator(); + let tmp=MANAGER_USER.getCurrentUser(); + if (tmp!=null){ + let match=m.createMatch(tmp, game); + nav.navigate("LobbySolo"); + } } \ No newline at end of file diff --git a/bob_party/src/core/Match/matchCreator.ts b/bob_party/src/core/Match/matchCreator.ts index 22f5eb4..5803af0 100644 --- a/bob_party/src/core/Match/matchCreator.ts +++ b/bob_party/src/core/Match/matchCreator.ts @@ -6,7 +6,7 @@ import { Match } from "./match"; export default class MatchCreator{ - async createMatchSolo(u:User, g:Game): Promise{ + async createMatch(u:User, g:Game): Promise{ return await MANAGER_MATCH.getsaverMatch().saveMatch(u, g); } } \ No newline at end of file