From: David NĂ©grier Date: Sun, 3 May 2020 13:51:16 +0000 (+0200) Subject: Merge X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=df5b183cba1c34be3f95056372a0564e026cf020;p=libreadventure.git Merge --- df5b183cba1c34be3f95056372a0564e026cf020 diff --cc front/src/Phaser/Game/GameManager.ts index 83e205e,2dd9fdf..ad4d5a2 --- a/front/src/Phaser/Game/GameManager.ts +++ b/front/src/Phaser/Game/GameManager.ts @@@ -21,13 -24,11 +25,12 @@@ export class GameManager constructor() { this.status = StatusGameManagerEnum.IN_PROGRESS; } - - connect(email:string) { - this.ConnexionInstance = new Connexion(email, this); + + connect(name:string) { + this.playerName = name; + this.ConnexionInstance = new Connexion(name, this); - ConnexionInstance = this.ConnexionInstance; return this.ConnexionInstance.createConnexion().then(() => { - this.SimplePeer = new SimplePeer(ConnexionInstance); + this.SimplePeer = new SimplePeer(this.ConnexionInstance); }); } @@@ -60,9 -61,9 +63,13 @@@ } } + getPlayerName(): string { + return this.playerName; + } ++ + pushPlayerPosition(event: HasMovedEvent) { + this.ConnexionInstance.sharePosition(event.x, event.y, event.direction); + } } -export const gameManager = new GameManager(); +export const gameManager = new GameManager();