diff --git a/test/testUtils/mocks/mockGameObject.ts b/test/testUtils/mocks/mockGameObject.ts index 0dff7c48c73..1e156b99d21 100644 --- a/test/testUtils/mocks/mockGameObject.ts +++ b/test/testUtils/mocks/mockGameObject.ts @@ -1,4 +1,7 @@ export interface MockGameObject { name: string; + active: boolean; destroy?(): void; + setActive(active: boolean): this; + setName(name: string): this; } diff --git a/test/testUtils/mocks/mockVideoGameObject.ts b/test/testUtils/mocks/mockVideoGameObject.ts index 65a5c37b244..1789229b1c7 100644 --- a/test/testUtils/mocks/mockVideoGameObject.ts +++ b/test/testUtils/mocks/mockVideoGameObject.ts @@ -3,11 +3,20 @@ import type { MockGameObject } from "./mockGameObject"; /** Mocks video-related stuff */ export class MockVideoGameObject implements MockGameObject { public name: string; + public active = true; public play = () => null; public stop = () => this; - public setOrigin = () => null; - public setScale = () => null; - public setVisible = () => null; - public setLoop = () => null; + public setOrigin = () => this; + public setScale = () => this; + public setVisible = () => this; + public setLoop = () => this; + public setName = (name: string) => { + this.name = name; + return this; + }; + public setActive = (active: boolean) => { + this.active = active; + return this; + }; } diff --git a/test/testUtils/mocks/mocksContainer/mockContainer.ts b/test/testUtils/mocks/mocksContainer/mockContainer.ts index 883c3856c26..f1371643ce3 100644 --- a/test/testUtils/mocks/mocksContainer/mockContainer.ts +++ b/test/testUtils/mocks/mocksContainer/mockContainer.ts @@ -14,6 +14,7 @@ export default class MockContainer implements MockGameObject { protected textureManager; public list: MockGameObject[] = []; public name: string; + public active = true; constructor(textureManager: MockTextureManager, x: number, y: number) { this.x = x; @@ -306,4 +307,9 @@ export default class MockContainer implements MockGameObject { } return this; } + + setActive(active: boolean): this { + this.active = active; + return this; + } } diff --git a/test/testUtils/mocks/mocksContainer/mockGraphics.ts b/test/testUtils/mocks/mocksContainer/mockGraphics.ts index 1650d2f9f60..cd43bb3a877 100644 --- a/test/testUtils/mocks/mocksContainer/mockGraphics.ts +++ b/test/testUtils/mocks/mocksContainer/mockGraphics.ts @@ -4,6 +4,7 @@ export default class MockGraphics implements MockGameObject { private scene; public list: MockGameObject[] = []; public name: string; + public active = true; constructor(textureManager, _config) { this.scene = textureManager.scene; } @@ -113,4 +114,9 @@ export default class MockGraphics implements MockGameObject { copyPosition(_source): this { return this; } + + setActive(active: boolean): this { + this.active = active; + return this; + } } diff --git a/test/testUtils/mocks/mocksContainer/mockRectangle.ts b/test/testUtils/mocks/mocksContainer/mockRectangle.ts index c11af824c56..7f54a0e255f 100644 --- a/test/testUtils/mocks/mocksContainer/mockRectangle.ts +++ b/test/testUtils/mocks/mocksContainer/mockRectangle.ts @@ -5,6 +5,7 @@ export default class MockRectangle implements MockGameObject { private scene; public list: MockGameObject[] = []; public name: string; + public active = true; constructor(textureManager, _x, _y, _width, _height, fillColor) { this.fillColor = fillColor; @@ -96,4 +97,9 @@ export default class MockRectangle implements MockGameObject { off(): this { return this; } + + setActive(active: boolean): this { + this.active = active; + return this; + } } diff --git a/test/testUtils/mocks/mocksContainer/mockSprite.ts b/test/testUtils/mocks/mocksContainer/mockSprite.ts index ad70b6ced07..df36b3a29fd 100644 --- a/test/testUtils/mocks/mocksContainer/mockSprite.ts +++ b/test/testUtils/mocks/mocksContainer/mockSprite.ts @@ -13,6 +13,7 @@ export default class MockSprite implements MockGameObject { public anims; public list: MockGameObject[] = []; public name: string; + public active = true; constructor(textureManager, x, y, texture) { this.textureManager = textureManager; this.scene = textureManager.scene; @@ -247,4 +248,9 @@ export default class MockSprite implements MockGameObject { this.phaserSprite.copyPosition(obj); return this; } + + setActive(active: boolean): this { + this.phaserSprite.setActive(active); + return this; + } } diff --git a/test/testUtils/mocks/mocksContainer/mockText.ts b/test/testUtils/mocks/mocksContainer/mockText.ts index 8f72cd0d34f..2345ff70c0d 100644 --- a/test/testUtils/mocks/mocksContainer/mockText.ts +++ b/test/testUtils/mocks/mocksContainer/mockText.ts @@ -12,6 +12,7 @@ export default class MockText implements MockGameObject { public text = ""; public name: string; public color?: string; + public active = true; constructor(textureManager, _x, _y, _content, _styleOptions) { this.scene = textureManager.scene; @@ -354,4 +355,8 @@ export default class MockText implements MockGameObject { // biome-ignore lint/complexity/noBannedTypes: This matches the signature of the class this mocks on(_event: string | symbol, _fn: Function, _context?: any) {} + + setActive(_active: boolean): this { + return this; + } } diff --git a/test/testUtils/mocks/mocksContainer/mockTexture.ts b/test/testUtils/mocks/mocksContainer/mockTexture.ts index eb8b70902fa..3b01f9ab4ea 100644 --- a/test/testUtils/mocks/mocksContainer/mockTexture.ts +++ b/test/testUtils/mocks/mocksContainer/mockTexture.ts @@ -12,6 +12,7 @@ export default class MockTexture implements MockGameObject { public frames: object; public firstFrame: string; public name: string; + public active: boolean; constructor(manager, key: string, source) { this.manager = manager; @@ -39,4 +40,14 @@ export default class MockTexture implements MockGameObject { getSourceImage() { return null; } + + setActive(active: boolean): this { + this.active = active; + return this; + } + + setName(name: string): this { + this.name = name; + return this; + } }