basic login page with a text input and a click button
This commit is contained in:
parent
33bcbd4650
commit
d691b58d0b
9 changed files with 107 additions and 25 deletions
|
@ -18,20 +18,16 @@ export interface GameManagerInterface {
|
|||
export class GameManager implements GameManagerInterface {
|
||||
GameScenes: Array<GameSceneInterface> = [];
|
||||
status: number;
|
||||
private ConnexionInstance: Connexion;
|
||||
|
||||
constructor() {
|
||||
this.status = StatusGameManagerEnum.IN_PROGRESS;
|
||||
ConnexionInstance = new Connexion("test@gmail.com", this);
|
||||
this.configureGame();
|
||||
}
|
||||
|
||||
createGame(){
|
||||
return ConnexionInstance.createConnexion().then(() => {
|
||||
this.configureGame();
|
||||
/** TODO add loader in the page **/
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
throw err;
|
||||
});
|
||||
|
||||
connect(email:string) {
|
||||
this.ConnexionInstance = new Connexion(email, this);
|
||||
return this.ConnexionInstance.createConnexion()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,8 +47,8 @@ export class GameManager implements GameManagerInterface {
|
|||
*/
|
||||
createCurrentPlayer(): void {
|
||||
//Get started room send by the backend
|
||||
let game: GameSceneInterface = this.GameScenes.find((Game: GameSceneInterface) => Game.RoomId === ConnexionInstance.startedRoom);
|
||||
game.createCurrentPlayer(ConnexionInstance.userId);
|
||||
let game: GameSceneInterface = this.GameScenes.find((Game: GameSceneInterface) => Game.RoomId === this.ConnexionInstance.startedRoom);
|
||||
game.createCurrentPlayer(this.ConnexionInstance.userId);
|
||||
this.status = StatusGameManagerEnum.CURRENT_USER_CREATED;
|
||||
}
|
||||
|
||||
|
@ -74,4 +70,6 @@ export class GameManager implements GameManagerInterface {
|
|||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const gameManager = new GameManager();
|
Loading…
Add table
Add a link
Reference in a new issue