Esempio n. 1
0
    private static void Login()
    {
        bool loggedIn = false;

        while (!loggedIn)
        {
            Console.WriteLine("Please Provide a username: "******"Successfully logged in.\n\n");
                }
                else
                {
                    int    choice = 0;
                    string Error  = "";
                    while (choice == 0)
                    {
                        Console.Clear();
                        Console.WriteLine("First time log in. \n\n This game doesn't use the Wisdom modifier. Do you wish to start with fresh stats, or modify your existing ones?");

                        Console.WriteLine("\n1: Fresh Stats\n\n2: Modify Existing");
                        Console.WriteLine();
                        if (string.IsNullOrEmpty(Error))
                        {
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine(Error);
                            Error = "";
                        }
                        Console.WriteLine();

                        string option = Console.ReadLine().ToString();
                        int.TryParse(option, out choice);

                        if (choice > 2 || choice < 0)
                        {
                            choice = 0;
                        }
                        if (choice == 0)
                        {
                            Error = "Please choose a valid option.";
                        }
                    }
                    GameSpecificAccount newAccount;
                    newAccount = new GameSpecificAccount(userAccount);
                    if (choice == 1)
                    {
                        newAccount.StrMod = 10 - newAccount.Strength;
                        newAccount.DexMod = 10 - newAccount.Dexterity;
                        newAccount.ConMod = 10 - newAccount.Constitution;
                        newAccount.ChaMod = 10 - newAccount.Charisma;
                        newAccount.IntMod = 10 - newAccount.Inteligence;
                    }
                    CreateAccount(newAccount);
                }
            }
            else
            {
                Console.WriteLine(response.Text);
            }
        }
    }