From d4470568ec98fa680f0ea51591fe56874844af64 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Fri, 29 Oct 2021 23:16:36 +0200 Subject: [PATCH 1/2] Fix change layer api functions --- front/src/Api/iframe/room.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Api/iframe/room.ts b/front/src/Api/iframe/room.ts index cfa02807..5eeadffe 100644 --- a/front/src/Api/iframe/room.ts +++ b/front/src/Api/iframe/room.ts @@ -94,7 +94,7 @@ export class WorkadventureRoomCommands extends IframeApiContribution { let subject = enterLayerStreams.get(layerName); if (subject === undefined) { - subject = new Subject(); + subject = new Subject(); enterLayerStreams.set(layerName, subject); } @@ -104,7 +104,7 @@ export class WorkadventureRoomCommands extends IframeApiContribution { let subject = leaveLayerStreams.get(layerName); if (subject === undefined) { - subject = new Subject(); + subject = new Subject(); leaveLayerStreams.set(layerName, subject); } From dbd6ce5bdc332c81697237dca06fb67691cb8aa5 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Fri, 29 Oct 2021 23:30:02 +0200 Subject: [PATCH 2/2] Fix player movement tests --- front/tests/Phaser/Game/PlayerMovementTest.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/front/tests/Phaser/Game/PlayerMovementTest.ts b/front/tests/Phaser/Game/PlayerMovementTest.ts index 4b9e8e99..70f7b95d 100644 --- a/front/tests/Phaser/Game/PlayerMovementTest.ts +++ b/front/tests/Phaser/Game/PlayerMovementTest.ts @@ -9,8 +9,8 @@ describe("Interpolation / Extrapolation", () => { { x: 200, y: 100, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, moving: true, direction: "up" }, @@ -24,8 +24,8 @@ describe("Interpolation / Extrapolation", () => { expect(playerMovement.getPosition(42100)).toEqual({ x: 150, y: 150, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, direction: 'up', moving: true }); @@ -33,8 +33,8 @@ describe("Interpolation / Extrapolation", () => { expect(playerMovement.getPosition(42200)).toEqual({ x: 200, y: 100, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, direction: 'up', moving: true }); @@ -42,8 +42,8 @@ describe("Interpolation / Extrapolation", () => { expect(playerMovement.getPosition(42300)).toEqual({ x: 250, y: 50, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, direction: 'up', moving: true }); @@ -56,8 +56,8 @@ describe("Interpolation / Extrapolation", () => { { x: 200, y: 100, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, moving: false, direction: "up" }, @@ -67,8 +67,8 @@ describe("Interpolation / Extrapolation", () => { expect(playerMovement.getPosition(42300)).toEqual({ x: 200, y: 100, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, direction: 'up', moving: false }); @@ -81,8 +81,8 @@ describe("Interpolation / Extrapolation", () => { { x: 200, y: 100, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, moving: false, direction: "up" }, @@ -92,8 +92,8 @@ describe("Interpolation / Extrapolation", () => { expect(playerMovement.getPosition(42100)).toEqual({ x: 150, y: 150, - oldX: undefined, - oldY: undefined, + oldX: 100, + oldY: 200, direction: 'up', moving: true });