workadventure/back/src/Model/Websocket/JoinRoomMessage.ts
gparant ba335aa33d Create backend
- NodeJs
 - Express
 - Socket.io
 - Eslint
 - TypeScript
2020-04-04 04:08:12 +02:00

23 lines
601 B
TypeScript

export class JoinRoomMessage {
userId: string;
roomId: string;
positionXUser: string;
positionYUser: string;
constructor(message: string) {
let data = JSON.parse(message);
this.userId = data.userId;
this.roomId = data.roomId;
this.positionXUser = data.positionXUser;
this.positionYUser = data.positionYUser;
}
toString(){
return JSON.stringify({
userId: this.userId,
roomId: this.roomId,
positionXUser: this.positionXUser,
positionYUser: this.positionYUser
})
}
}