Example #1
0
        /// <summary>
        /// Asks the player which type of hero they want to play with.
        /// </summary>
        /// <returns>Hero type number</returns>
        public static int GetHeroType()
        {
            GameWriter.DisplayHeroOptions();
            var typeInput = ReadLine();
            int heroType;

            while (!int.TryParse(typeInput, out heroType) || heroType < 1 || heroType > 4)
            {
                GameWriter.ClearScreen();
                GameWriter.AskForNumberMessage(1, 4);
                GameWriter.DisplayHeroOptions();
                typeInput = ReadLine();
            }

            GameWriter.ClearScreen();
            return(heroType);
        }