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;
}
export class GameManager {
- status: number;
+ //status: number;
private ConnectionInstance: Connection;
private currentGameScene: GameScene;
private playerName: string;
private characterUserSelected: string;
constructor() {
- this.status = StatusGameManagerEnum.IN_PROGRESS;
+ //this.status = StatusGameManagerEnum.IN_PROGRESS;
}
connect(name: string, characterUserSelected : string) {
/**
* 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);
* 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) {
}
deleteGroup(groupId: string): void {
- if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
+ /*if (this.status === StatusGameManagerEnum.IN_PROGRESS) {
return;
- }
+ }*/
try {
this.currentGameScene.deleteGroup(groupId)
} catch (e) {