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:
parent
f44a44c109
commit
ab798b1c09
9 changed files with 101 additions and 88 deletions
|
@ -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) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue