async chooseProfile() {
    const profiles = this.getProfiles();
    if (profiles.length) {
      const newProfileChoice = 'New profile';
      const profileChoices = [...profiles, SEPARATOR, newProfileChoice];
      const profile = await requestChoice('Choose a profile:', profileChoices);
      if (profile !== newProfileChoice) {
        return profile;
      }
    }

    return this.createProfile();
  }
/**
   * Gives the player the option to choose one of the available profiles.
   *
   * If there are no profiles available in the game directory or the player
   * chooses to, creates a new profile.
   *
   * @returns {Profile} The chosen profile.
   */
Gives the player the option to choose one of the available profiles.
If there are no profiles available in the game directory or the player
chooses to, creates a new profile.

@returns {Profile} The chosen profile.
Gives the player the option to choose one of the available profiles . If there are no profiles available in the game directory or the player chooses to creates a new profile . @returns { Profile } The chosen profile .
async chooseProfile() {
    const profiles = this.getProfiles();
    if (profiles.length) {
      const newProfileChoice = 'New profile';
      const profileChoices = [...profiles, SEPARATOR, newProfileChoice];
      const profile = await requestChoice('Choose a profile:', profileChoices);
      if (profile !== newProfileChoice) {
        return profile;
      }
    }
    return this.createProfile();
  }
async chooseProfile ( ) { const profiles = this . getProfiles ( ) ; if ( profiles . length ) { const newProfileChoice = 'New profile' ; const profileChoices = [ ... profiles , SEPARATOR , newProfileChoice ] ; const profile = await requestChoice ( 'Choose a profile:' , profileChoices ) ; if ( profile !== newProfileChoice ) { return profile ; } } return this . createProfile ( ) ; }
Gives the player the option to choose one of the available profiles.
Gives the player the option to choose one of the available profiles .