From: David NĂ©grier Date: Sun, 24 May 2020 21:33:56 +0000 (+0200) Subject: Commenting out the notion of status in the GameManager X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=21576946f0fe25df2e2a730a7a27148ab90a389e;p=libreadventure.git Commenting out the notion of status in the GameManager It seems to be useless --- diff --git a/front/src/Phaser/Game/GameManager.ts b/front/src/Phaser/Game/GameManager.ts index 1e582f4..7f89504 100644 --- a/front/src/Phaser/Game/GameManager.ts +++ b/front/src/Phaser/Game/GameManager.ts @@ -13,10 +13,10 @@ import {SimplePeerInterface, SimplePeer} from "../../WebRtc/SimplePeer"; import {AddPlayerInterface} from "./AddPlayerInterface"; import {ReconnectingSceneName} from "../Reconnecting/ReconnectingScene"; -export enum StatusGameManagerEnum { +/*export enum StatusGameManagerEnum { IN_PROGRESS = 1, CURRENT_USER_CREATED = 2 -} +}*/ export interface HasMovedEvent { direction: string; @@ -31,7 +31,7 @@ export interface MapObject { } export class GameManager { - status: number; + //status: number; private ConnectionInstance: Connection; private currentGameScene: GameScene; private playerName: string; @@ -39,7 +39,7 @@ export class GameManager { private characterUserSelected: string; constructor() { - this.status = StatusGameManagerEnum.IN_PROGRESS; + //this.status = StatusGameManagerEnum.IN_PROGRESS; } connect(name: string, characterUserSelected : string) { @@ -70,11 +70,11 @@ export class GameManager { /** * Permit to create player in started room */ - createCurrentPlayer(): void { + /*createCurrentPlayer(): void { //Get started room send by the backend this.currentGameScene.createCurrentPlayer(); - this.status = StatusGameManagerEnum.CURRENT_USER_CREATED; - } + //this.status = StatusGameManagerEnum.CURRENT_USER_CREATED; + }*/ joinRoom(sceneKey: string, startX: number, startY: number, direction: string, moving: boolean){ this.ConnectionInstance.joinARoom(sceneKey, startX, startY, direction, moving); @@ -114,9 +114,9 @@ export class GameManager { * Share group position in game */ shareGroupPosition(groupPositionMessage: GroupCreatedUpdatedMessageInterface): void { - if (this.status === StatusGameManagerEnum.IN_PROGRESS) { + /*if (this.status === StatusGameManagerEnum.IN_PROGRESS) { return; - } + }*/ try { this.currentGameScene.shareGroupPosition(groupPositionMessage) } catch (e) { @@ -125,9 +125,9 @@ export class GameManager { } deleteGroup(groupId: string): void { - if (this.status === StatusGameManagerEnum.IN_PROGRESS) { + /*if (this.status === StatusGameManagerEnum.IN_PROGRESS) { return; - } + }*/ try { this.currentGameScene.deleteGroup(groupId) } catch (e) { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index b7afed0..41f6f21 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -145,7 +145,7 @@ export class GameScene extends Phaser.Scene { this.MapPlayers = this.physics.add.group({ immovable: true }); //notify game manager can to create currentUser in map - this.GameManager.createCurrentPlayer(); + this.createCurrentPlayer(); //initialise camera this.initCamera();