Merge pull request #1546 from thecodingmachine/fix-room-api
Fix change layer api functions
This commit is contained in:
commit
ec3120cf8f
2 changed files with 18 additions and 18 deletions
|
@ -94,7 +94,7 @@ export class WorkadventureRoomCommands extends IframeApiContribution<Workadventu
|
||||||
onEnterLayer(layerName: string): Subject<void> {
|
onEnterLayer(layerName: string): Subject<void> {
|
||||||
let subject = enterLayerStreams.get(layerName);
|
let subject = enterLayerStreams.get(layerName);
|
||||||
if (subject === undefined) {
|
if (subject === undefined) {
|
||||||
subject = new Subject<ChangeLayerEvent>();
|
subject = new Subject<void>();
|
||||||
enterLayerStreams.set(layerName, subject);
|
enterLayerStreams.set(layerName, subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ export class WorkadventureRoomCommands extends IframeApiContribution<Workadventu
|
||||||
onLeaveLayer(layerName: string): Subject<void> {
|
onLeaveLayer(layerName: string): Subject<void> {
|
||||||
let subject = leaveLayerStreams.get(layerName);
|
let subject = leaveLayerStreams.get(layerName);
|
||||||
if (subject === undefined) {
|
if (subject === undefined) {
|
||||||
subject = new Subject<ChangeLayerEvent>();
|
subject = new Subject<void>();
|
||||||
leaveLayerStreams.set(layerName, subject);
|
leaveLayerStreams.set(layerName, subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
{
|
{
|
||||||
x: 200,
|
x: 200,
|
||||||
y: 100,
|
y: 100,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
moving: true,
|
moving: true,
|
||||||
direction: "up"
|
direction: "up"
|
||||||
},
|
},
|
||||||
|
@ -24,8 +24,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
expect(playerMovement.getPosition(42100)).toEqual({
|
expect(playerMovement.getPosition(42100)).toEqual({
|
||||||
x: 150,
|
x: 150,
|
||||||
y: 150,
|
y: 150,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
direction: 'up',
|
direction: 'up',
|
||||||
moving: true
|
moving: true
|
||||||
});
|
});
|
||||||
|
@ -33,8 +33,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
expect(playerMovement.getPosition(42200)).toEqual({
|
expect(playerMovement.getPosition(42200)).toEqual({
|
||||||
x: 200,
|
x: 200,
|
||||||
y: 100,
|
y: 100,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
direction: 'up',
|
direction: 'up',
|
||||||
moving: true
|
moving: true
|
||||||
});
|
});
|
||||||
|
@ -42,8 +42,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
expect(playerMovement.getPosition(42300)).toEqual({
|
expect(playerMovement.getPosition(42300)).toEqual({
|
||||||
x: 250,
|
x: 250,
|
||||||
y: 50,
|
y: 50,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
direction: 'up',
|
direction: 'up',
|
||||||
moving: true
|
moving: true
|
||||||
});
|
});
|
||||||
|
@ -56,8 +56,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
{
|
{
|
||||||
x: 200,
|
x: 200,
|
||||||
y: 100,
|
y: 100,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
moving: false,
|
moving: false,
|
||||||
direction: "up"
|
direction: "up"
|
||||||
},
|
},
|
||||||
|
@ -67,8 +67,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
expect(playerMovement.getPosition(42300)).toEqual({
|
expect(playerMovement.getPosition(42300)).toEqual({
|
||||||
x: 200,
|
x: 200,
|
||||||
y: 100,
|
y: 100,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
direction: 'up',
|
direction: 'up',
|
||||||
moving: false
|
moving: false
|
||||||
});
|
});
|
||||||
|
@ -81,8 +81,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
{
|
{
|
||||||
x: 200,
|
x: 200,
|
||||||
y: 100,
|
y: 100,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
moving: false,
|
moving: false,
|
||||||
direction: "up"
|
direction: "up"
|
||||||
},
|
},
|
||||||
|
@ -92,8 +92,8 @@ describe("Interpolation / Extrapolation", () => {
|
||||||
expect(playerMovement.getPosition(42100)).toEqual({
|
expect(playerMovement.getPosition(42100)).toEqual({
|
||||||
x: 150,
|
x: 150,
|
||||||
y: 150,
|
y: 150,
|
||||||
oldX: undefined,
|
oldX: 100,
|
||||||
oldY: undefined,
|
oldY: 200,
|
||||||
direction: 'up',
|
direction: 'up',
|
||||||
moving: true
|
moving: true
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue