src/main/java/cursor/rybak/game/UserInteraction.java
/**
     * ask about team members (can be from different races)
     *
     * @param teamMembers heroes number in team
     * @return array of heroes
     */
ask about team members (can be from different races)
@param teamMembers heroes number in team
@return array of heroes
ask about team members ( can be from different races ) @param teamMembers heroes number in team @return array of heroes
public static AbstractRace[] askHeroes(int teamMembers) {
        ArrayList<AbstractRace> teamHeroes = new ArrayList<>();
        Message.askHeroLeader();
        while (teamHeroes.size() < teamMembers) {
            initializeHero(teamHeroes);
            int currentTeamSize = teamHeroes.size();
            if (currentTeamSize < teamMembers) {
                Message.askMoreHero(currentTeamSize, teamMembers);
            }
        }
        return teamHeroes.toArray(new AbstractRace[teamHeroes.size()]);
    }
public static AbstractRace [ ] askHeroes ( int teamMembers ) { ArrayList < AbstractRace > teamHeroes = new ArrayList < > ( ) ; Message . askHeroLeader ( ) ; while ( teamHeroes . size ( ) < teamMembers ) { initializeHero ( teamHeroes ) ; int currentTeamSize = teamHeroes . size ( ) ; if ( currentTeamSize < teamMembers ) { Message . askMoreHero ( currentTeamSize , teamMembers ) ; } } return teamHeroes . toArray ( new AbstractRace [ teamHeroes . size ( ) ] ) ; }
ask about team members (can be from different races)
 @param teamMembers heroes number in team
 @return array of heroes
ask about team members ( can be from different races ) @param teamMembers heroes number in team @return array of heroes