src/util/GameHandler.js
/**
     * it starts a new Game
     * this method takes the player's name and starts a new game by loading Questions with the help of the Facade class
     */
it starts a new Game
this method takes the player's name and starts a new game by loading Questions with the help of the Facade class
it starts a new Game this method takes the player ' s name and starts a new game by loading Questions with the help of the Facade class
async startNewGame() {
        console.log(chalk.blue('Stating new game...'));
        var player;
        var self = this;
        const response = await prompt({
            type: 'input',
            name: 'name',
            message: chalk.green('Enter player name: '),
            validate(value, state, item, index) {
                if (_.isUndefined(value) || value.trim().length === 0) {
                    return "Please insert a name";
                } else {
                    return true;
                }
            }
        });
        player = new Player(response.name);
        console.log(chalk.blue('Loading...'));
        self.facade.loadQuestions().then(
            async questions => {
                console.log(chalk.blue('Questions successfully loaded.'));
                var game = new Game(player, questions);
                game.startNewGame();
            }
        );
    }
async startNewGame ( ) { console . log ( chalk . blue ( 'Stating new game...' ) ) ; var player ; var self = this ; const response = await prompt ( { type : 'input' , name : 'name' , message : chalk . green ( 'Enter player name: ' ) , validate ( value , state , item , index ) { if ( _ . isUndefined ( value ) || value . trim ( ) . length === 0 ) { return "Please insert a name" ; } else { return true ; } } } ) ; player = new Player ( response . name ) ; console . log ( chalk . blue ( 'Loading...' ) ) ; self . facade . loadQuestions ( ) . then ( async questions => { console . log ( chalk . blue ( 'Questions successfully loaded.' ) ) ; var game = new Game ( player , questions ) ; game . startNewGame ( ) ; } ) ; }
it starts a new Game
 this method takes the player's name and starts a new game by loading Questions with the help of the Facade class
it starts a new Game this method takes the player ' s name and starts a new game by loading Questions with the help of the Facade class