Migrating position notification into the User class

This commit is contained in:
David Négrier 2020-09-25 15:25:06 +02:00
parent 892d1555b8
commit 23cea1c835
7 changed files with 59 additions and 52 deletions

View file

@ -25,10 +25,10 @@ export class Zone {
const result = this.things.delete(thing);
if (!result) {
if (thing instanceof User) {
console.error('Could not find user in zone '+thing.id);
throw new Error('Could not find user in zone '+thing.id);
}
if (thing instanceof Group) {
console.error('Could not find group '+thing.getId()+' in zone ('+this.x+','+this.y+'). Position of group: ('+thing.getPosition().x+','+thing.getPosition().y+')');
throw new Error('Could not find group '+thing.getId()+' in zone ('+this.x+','+this.y+'). Position of group: ('+thing.getPosition().x+','+thing.getPosition().y+')');
}
}