Apply suggestions from code review

This commit is contained in:
Michael Li 2025-01-04 12:59:53 -05:00 committed by Sirz Benjie
parent 951f29f729
commit 4c9e9a4adf
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 4 additions and 6 deletions

View File

@ -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 ]) {

View File

@ -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.