workadventure/back/src/Model/Websocket/Message.ts
David Négrier 492196b333 Cleanup: renaming "frame" to "character"
The "frame" variable actually contains a string pointing to the character selected.
It has nothing to do with a frame which is usually a particular image in an animation.

I'm renaming the variable accross the application to avoid confusion.
2020-05-08 15:18:22 +02:00

26 lines
580 B
TypeScript

export class Message {
userId: string;
roomId: string;
name: string;
character: string;
constructor(data: any) {
if (!data.userId || !data.roomId) {
throw Error("userId or roomId cannot be null");
}
this.userId = data.userId;
this.roomId = data.roomId;
this.name = data.name;
this.character = data.character;
}
toJson() {
return {
userId: this.userId,
roomId: this.roomId,
name: this.name,
character: this.character
}
}
}