Commenting out the notion of status in the GameManager

It seems to be useless
This commit is contained in:
David Négrier 2020-05-24 23:33:56 +02:00
parent 62cb8cca87
commit 21576946f0
2 changed files with 12 additions and 12 deletions

View File

@ -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) {

View File

@ -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();