From 21576946f0fe25df2e2a730a7a27148ab90a389e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Sun, 24 May 2020 23:33:56 +0200 Subject: [PATCH] Commenting out the notion of status in the GameManager It seems to be useless --- front/src/Phaser/Game/GameManager.ts | 22 +++++++++++----------- front/src/Phaser/Game/GameScene.ts | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/front/src/Phaser/Game/GameManager.ts b/front/src/Phaser/Game/GameManager.ts index 1e582f4b..7f895048 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 b7afed02..41f6f212 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();