Deleting world when empty.
This commit is contained in:
parent
d9e6b501b1
commit
9bdcc9da98
2 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,10 @@ export class World {
|
|||
this.users.delete(user.userId);
|
||||
}
|
||||
|
||||
public isEmpty(): boolean {
|
||||
return this.users.size === 0;
|
||||
}
|
||||
|
||||
public updatePosition(socket : Identificable, userPosition: PointInterface): void {
|
||||
const user = this.users.get(socket.userId);
|
||||
if(typeof user === 'undefined') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue