Changing the "Point" notion to add a notion of "moving" in addition to the notion of direction.

Also, refactoring JOIN_ROOM event to add complete position.
This commit is contained in:
David Négrier 2020-05-22 22:59:43 +02:00
parent f44a44c109
commit ab798b1c09
9 changed files with 101 additions and 88 deletions

View file

@ -1,5 +1,7 @@
import {Point} from "./MessageUserPosition";
import {PointInterface} from "_Model/Websocket/PointInterface";
export class MessageUserJoined {
constructor(public userId: string, public name: string, public character: string) {
constructor(public userId: string, public name: string, public character: string, public position: PointInterface) {
}
}

View file

@ -1,7 +1,7 @@
import {PointInterface} from "./PointInterface";
export class Point implements PointInterface{
constructor(public x : number, public y : number, public direction : string = "none") {
constructor(public x : number, public y : number, public direction : string = "none", public moving : boolean = false) {
}
}