From 4c9e9a4adfea09dff43e33ac1c7cdbe5f6fea25f Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sat, 4 Jan 2025 12:59:53 -0500 Subject: [PATCH] Apply suggestions from code review --- src/battle-scene.ts | 6 +++--- test/utils/gameManager.ts | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 7801cea2a36..68b796ee5c0 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2369,7 +2369,9 @@ export default class BattleScene extends SceneBase { } /** - * Clears the phaseQueue + * Clears the phaseQueue, but does not clear any other phase-related stuff. + * + * TODO: Should this function be replaced by {@linkcode clearAllPhases}? */ clearPhaseQueue(): void { this.phaseQueue.splice(0, this.phaseQueue.length); @@ -2377,8 +2379,6 @@ export default class BattleScene extends SceneBase { /** * Clears all phase-related stuff, including all phase queues, the current and standby phases, and a splice index. - * - * Currently, this is a utility function only used by unit tests. */ clearAllPhases(): void { for (const queue of [ this.phaseQueue, this.phaseQueuePrepend, this.conditionalQueue, this.nextCommandPhaseQueue ]) { diff --git a/test/utils/gameManager.ts b/test/utils/gameManager.ts index b5d9ad8fe8e..bbe3fc4c859 100644 --- a/test/utils/gameManager.ts +++ b/test/utils/gameManager.ts @@ -57,7 +57,6 @@ import fs from "fs"; import { expect, vi } from "vitest"; import { globalScene } from "#app/global-scene"; import type StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; -import { GameData } from "#app/system/game-data"; /** * Class to manage the game state and transitions between phases. @@ -100,9 +99,8 @@ export default class GameManager { this.phaseInterceptor = new PhaseInterceptor(this.scene); if (!firstTimeScene) { - this.scene.reset(); + this.scene.reset(false, true); (this.scene.ui.handlers[Mode.STARTER_SELECT] as StarterSelectUiHandler).clearStarterPreferences(); - this.scene.gameData = new GameData(); this.scene.clearAllPhases(); // This part, in particular, must not be run before the PhaseInterceptor has been initialized.