Ejemplo n.º 1
0
        public static void NewPlayer()
        {
            //get the user input
            string usersInput;
            //always false until user adds input
            bool validAnswer = false;

            while (validAnswer == false)
            {
                Console.WriteLine("Are you new to Avalon?");
                Console.Write("> ");
                usersInput = Console.ReadLine();

                if (usersInput.ToLower() == "no") //Get save data info
                {
                    validAnswer = true;
                    Console.WriteLine("What is your name?");
                    usersInput = CapWords.FirstCharToUpper(Console.ReadLine());
                    LoadPlayer.LoadGame(usersInput.ToLower());
                }
                else if (usersInput.ToLower() == "yes") // Move on to create the player
                {
                    validAnswer = true;
                    CreatePlayer.CreateAPlayer();
                }
                else
                {
                    Console.WriteLine("Enter a valid answer.");
                }
            }
        }
Ejemplo n.º 2
0
        public static void PContinue(Player player)
        {
            string usersInput;
            bool   validAnswer = false;

            while (validAnswer == false)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("You are a weakling");
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine("Would you like to Continue?");
                Console.WriteLine("Yes, No, or Create");
                Console.Write("> ");
                usersInput = Console.ReadLine();
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine();

                if (usersInput.ToLower() == "no")
                {
                    Environment.Exit(0);
                }
                else if (usersInput.ToLower() == "yes")
                {
                    LocationCurrent.CurrentLocation();
                    break;
                }
                else if (usersInput.ToLower() == "create")
                {
                    Console.Clear(); // clear Console to keep clean
                    CreatePlayer.CreateAPlayer();
                    LocationCurrent.CurrentLocation();
                    break;
                }
                else
                {
                    Console.WriteLine("Enter a valid answer.");
                }
            }
        }