+12
-10
@@ -54,17 +54,19 @@ export class GameObjectRegister {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_object(obj: GameObjectNetcode) {
|
update_object(obj: GameObjectNetcode) {
|
||||||
if (unref(this.current_game)?.uuid === obj.uuid) {
|
// console.log(obj);
|
||||||
Object.assign(this.current_game as any, obj);
|
// console.log(obj.uuid);
|
||||||
} else if (unref(this.lobby)?.uuid === obj.uuid) {
|
// console.log(this.objects.get(obj.uuid));
|
||||||
Object.assign(this.lobby as any, obj);
|
|
||||||
} else if (unref(this.self)?.uuid === obj.uuid) {
|
|
||||||
Object.assign(this.self as any, obj);
|
|
||||||
}
|
|
||||||
console.log(obj);
|
|
||||||
console.log(obj.uuid);
|
|
||||||
console.log(this.objects.get(obj.uuid));
|
|
||||||
Object.assign(this.objects.get(obj.uuid) as GameNetcode, obj);
|
Object.assign(this.objects.get(obj.uuid) as GameNetcode, obj);
|
||||||
|
if (unref(this.current_game)?.uuid === obj.uuid) {
|
||||||
|
triggerRef(this.current_game);
|
||||||
|
} else if (unref(this.lobby)?.uuid === obj.uuid) {
|
||||||
|
triggerRef(this.lobby);
|
||||||
|
} else if (unref(this.self)?.uuid === obj.uuid) {
|
||||||
|
triggerRef(this.self);
|
||||||
|
} else if (unref(this.self)?.turn?.uuid === obj.uuid) {
|
||||||
|
triggerRef(this.self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createObject = {
|
createObject = {
|
||||||
|
|||||||
Reference in New Issue
Block a user