# Class default

Class to manage the game state and transitions between phases.

- Defined in src/test/utils/gameManager.ts:33

#####
Index

### Constructors

constructor

### Properties

gameWrapper
inputsHandler
phaseInterceptor
scene
textInterceptor

### Methods

endPhase
exportSaveToTest
importData
isCurrentMode
isCurrentPhase
isVictory
onNextPrompt
runToSummon
runToTitle
setMode
startBattle
waitMode

## Constructors

### constructor

- new default(phaserGame, bypassLogin?): default

- Creates an instance of GameManager.

  #### Parameters

  - phaserGame: Game

    The Phaser game instance.

  - bypassLogin: boolean = true

    Whether to bypass the login phase.

  #### Returns default

  - Defined in src/test/utils/gameManager.ts:45

## Properties

### gameWrapper

gameWrapper: default

- Defined in src/test/utils/gameManager.ts:34

### inputsHandler

inputsHandler: default

- Defined in src/test/utils/gameManager.ts:38

### phaseInterceptor

phaseInterceptor: default

- Defined in src/test/utils/gameManager.ts:36

### scene

scene: default

- Defined in src/test/utils/gameManager.ts:35

### textInterceptor

textInterceptor: default

- Defined in src/test/utils/gameManager.ts:37

## Methods

### endPhase

- endPhase(): void

- Ends the current phase.

  #### Returns void

  - Defined in src/test/utils/gameManager.ts:77

### exportSaveToTest

- exportSaveToTest(): Promise<string>

- Exports the save data to import it in a test game.

  #### Returns Promise<string>

  A promise that resolves with the exported save data.

  - Defined in src/test/utils/gameManager.ts:195

### importData

- importData(path): Promise<[boolean, number]>

- Imports game data from a file.

  #### Parameters

  - path: any

    The path to the data file.

  #### Returns Promise<[boolean, number]>

  A promise that resolves with a tuple containing a boolean indicating success and an integer status code.

  - Defined in src/test/utils/gameManager.ts:211

### isCurrentMode

- isCurrentMode(mode): boolean

- Checks if the current mode matches the target mode.

  #### Parameters

  - mode: Mode

    The target mode.

  #### Returns boolean

  True if the current mode matches the target mode, otherwise false.

  - Defined in src/test/utils/gameManager.ts:187

### isCurrentPhase

- isCurrentPhase(phaseTarget): boolean

- Checks if the current phase matches the target phase.

  #### Parameters

  - phaseTarget: any

    The target phase.

  #### Returns boolean

  True if the current phase matches the target phase, otherwise false.

  - Defined in src/test/utils/gameManager.ts:177

### isVictory

- isVictory(): boolean

- Checks if the player has won the battle.

  #### Returns boolean

  True if the player has won, otherwise false.

  - Defined in src/test/utils/gameManager.ts:168

### onNextPrompt

- onNextPrompt(phaseTarget, mode, callback, expireFn?): void

- Adds an action to be executed on the next prompt.

  #### Parameters

  - phaseTarget: string

    The target phase.

  - mode: Mode

    The mode to wait for.

  - callback: (() => void)

    The callback to execute.

    - - (): void

      - #### Returns void

  - `Optional` expireFn: (() => void)

    Optional function to determine if the prompt has expired.

    - - (): void

      - #### Returns void

  - Defined in src/test/utils/gameManager.ts:88

### runToSummon

- runToSummon(species?): Promise<void>

- Runs the game to the summon phase.

  #### Parameters

  - `Optional` species: Species []

    Optional array of species to summon.

  #### Returns Promise<void>

  A promise that resolves when the summon phase is reached.

  - Defined in src/test/utils/gameManager.ts:120

### runToTitle

- runToTitle(): Promise<void>

- Runs the game to the title phase.

  #### Returns Promise<void>

  A promise that resolves when the title phase is reached.

  - Defined in src/test/utils/gameManager.ts:96

### setMode

- setMode(mode): void

- Sets the game mode.

  #### Parameters

  - mode: Mode

    The mode to set.

  #### Returns void

  - Defined in src/test/utils/gameManager.ts:58

### startBattle

- startBattle(species?): Promise<void>

- Starts a battle.

  #### Parameters

  - `Optional` species: Species []

    Optional array of species to start the battle with.

  #### Returns Promise<void>

  A promise that resolves when the battle is started.

  - Defined in src/test/utils/gameManager.ts:140

### waitMode

- waitMode(mode): Promise<void>

- Waits until the specified mode is set.

  #### Parameters

  - mode: Mode

    The mode to wait for.

  #### Returns Promise<void>

  A promise that resolves when the mode is set.

  - Defined in src/test/utils/gameManager.ts:67