mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 21:42:20 +02:00
[Test] Fix mocks' add method to match phaser signature (#5885)
This commit is contained in:
parent
86fa3198fd
commit
f9e6785c35
@ -214,9 +214,12 @@ export default class MockContainer implements MockGameObject {
|
||||
return this;
|
||||
}
|
||||
|
||||
add(...obj: MockGameObject[]): this {
|
||||
// Adds a child to this Game Object.
|
||||
this.list.push(...obj);
|
||||
add(obj: MockGameObject | MockGameObject[]): this {
|
||||
if (Array.isArray(obj)) {
|
||||
this.list.push(...obj);
|
||||
} else {
|
||||
this.list.push(obj);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,13 @@ export default class MockRectangle implements MockGameObject {
|
||||
this.list = [];
|
||||
}
|
||||
|
||||
add(obj): this {
|
||||
add(obj: MockGameObject | MockGameObject[]): this {
|
||||
// Adds a child to this Game Object.
|
||||
this.list.push(obj);
|
||||
if (Array.isArray(obj)) {
|
||||
this.list.push(...obj);
|
||||
} else {
|
||||
this.list.push(obj);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -201,9 +201,13 @@ export default class MockSprite implements MockGameObject {
|
||||
return this;
|
||||
}
|
||||
|
||||
add(obj): this {
|
||||
add(obj: MockGameObject | MockGameObject[]): this {
|
||||
// Adds a child to this Game Object.
|
||||
this.list.push(obj);
|
||||
if (Array.isArray(obj)) {
|
||||
this.list.push(...obj);
|
||||
} else {
|
||||
this.list.push(obj);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user