mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Fix mocks' add method to match phaser signature
This commit is contained in:
parent
86fa3198fd
commit
ae54005111
@ -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