Commenting out the notion of status in the GameManager
It seems to be useless
This commit is contained in:
parent
62cb8cca87
commit
21576946f0
@ -13,10 +13,10 @@ import {SimplePeerInterface, SimplePeer} from "../../WebRtc/SimplePeer";
|
|||||||
import {AddPlayerInterface} from "./AddPlayerInterface";
|
import {AddPlayerInterface} from "./AddPlayerInterface";
|
||||||
import {ReconnectingSceneName} from "../Reconnecting/ReconnectingScene";
|
import {ReconnectingSceneName} from "../Reconnecting/ReconnectingScene";
|
||||||
|
|
||||||
export enum StatusGameManagerEnum {
|
/*export enum StatusGameManagerEnum {
|
||||||
IN_PROGRESS = 1,
|
IN_PROGRESS = 1,
|
||||||
CURRENT_USER_CREATED = 2
|
CURRENT_USER_CREATED = 2
|
||||||
}
|
}*/
|
||||||
|
|
||||||
export interface HasMovedEvent {
|
export interface HasMovedEvent {
|
||||||
direction: string;
|
direction: string;
|
||||||
@ -31,7 +31,7 @@ export interface MapObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class GameManager {
|
export class GameManager {
|
||||||
status: number;
|
//status: number;
|
||||||
private ConnectionInstance: Connection;
|
private ConnectionInstance: Connection;
|
||||||
private currentGameScene: GameScene;
|
private currentGameScene: GameScene;
|
||||||
private playerName: string;
|
private playerName: string;
|
||||||
@ -39,7 +39,7 @@ export class GameManager {
|
|||||||
private characterUserSelected: string;
|
private characterUserSelected: string;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.status = StatusGameManagerEnum.IN_PROGRESS;
|
//this.status = StatusGameManagerEnum.IN_PROGRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(name: string, characterUserSelected : string) {
|
connect(name: string, characterUserSelected : string) {
|
||||||
@ -70,11 +70,11 @@ export class GameManager {
|
|||||||
/**
|
/**
|
||||||
* Permit to create player in started room
|
* Permit to create player in started room
|
||||||
*/
|
*/
|
||||||
createCurrentPlayer(): void {
|
/*createCurrentPlayer(): void {
|
||||||
//Get started room send by the backend
|
//Get started room send by the backend
|
||||||
this.currentGameScene.createCurrentPlayer();
|
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){
|
joinRoom(sceneKey: string, startX: number, startY: number, direction: string, moving: boolean){
|
||||||
this.ConnectionInstance.joinARoom(sceneKey, startX, startY, direction, moving);
|
this.ConnectionInstance.joinARoom(sceneKey, startX, startY, direction, moving);
|
||||||
@ -114,9 +114,9 @@ export class GameManager {
|
|||||||
* Share group position in game
|
* Share group position in game
|
||||||
*/
|
*/
|
||||||
shareGroupPosition(groupPositionMessage: GroupCreatedUpdatedMessageInterface): void {
|
shareGroupPosition(groupPositionMessage: GroupCreatedUpdatedMessageInterface): void {
|
||||||
if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
|
/*if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
try {
|
try {
|
||||||
this.currentGameScene.shareGroupPosition(groupPositionMessage)
|
this.currentGameScene.shareGroupPosition(groupPositionMessage)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -125,9 +125,9 @@ export class GameManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteGroup(groupId: string): void {
|
deleteGroup(groupId: string): void {
|
||||||
if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
|
/*if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
try {
|
try {
|
||||||
this.currentGameScene.deleteGroup(groupId)
|
this.currentGameScene.deleteGroup(groupId)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -145,7 +145,7 @@ export class GameScene extends Phaser.Scene {
|
|||||||
this.MapPlayers = this.physics.add.group({ immovable: true });
|
this.MapPlayers = this.physics.add.group({ immovable: true });
|
||||||
|
|
||||||
//notify game manager can to create currentUser in map
|
//notify game manager can to create currentUser in map
|
||||||
this.GameManager.createCurrentPlayer();
|
this.createCurrentPlayer();
|
||||||
|
|
||||||
//initialise camera
|
//initialise camera
|
||||||
this.initCamera();
|
this.initCamera();
|
||||||
|
Loading…
Reference in New Issue
Block a user