Skip to content

Commit

Permalink
refactor: Add exitToChoiceMenu method to GameStepManager
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed May 19, 2024
1 parent 0d44171 commit 135342e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/managers/StepManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,22 @@ export default class GameStepManager {
}
return await GameStepManager.runCurrentStep<T>(props)
}
/**
* When the player is in a choice menu, can use this function to exit to the choice menu.
* @param props The props to pass to the step.
* @returns StepLabelResultType or undefined.
* @example
* ```typescript
* GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
* if (result) {
* // your code
* }
* })
* ```
*/
public static async exitToChoiceMenu<T extends {}>(props?: StepLabelPropsType<T>): Promise<StepLabelResultType> {
return GameStepManager.runNextStep(props)
}

/* After Update Methods */

Expand Down

0 comments on commit 135342e

Please sign in to comment.