private void TryToLogUp() { ColorEngine.Yellow(); Console.WriteLine(); Console.WriteLine(new string('*', 10) + "Create account:" + new string('*', 10)); CurrentUserAccount = GetAccountWithData(); Validator = new UsersValidator(CurrentUserAccount); if (Validator.IsValid()) { bool ifCreationIsSuccessfully = DataBase.CreateNewUserAccount(CurrentUserAccount); if (ifCreationIsSuccessfully) { ColorEngine.Yellow(); Console.Write($"Welcome {CurrentUserAccount.Name}..."); Console.WriteLine("\tLet's start to play"); Console.WriteLine(); } else { ColorEngine.Red(); Console.WriteLine("This account already exists."); Again(TryToLogUp); } } else { Again(TryToLogUp); } }
private void TryToLogIn() { ColorEngine.Yellow(); Console.WriteLine(); Console.WriteLine(new string('*', 10) + "Login:"******"This account already exists."); Again(TryToLogIn); } else { ColorEngine.Yellow(); Console.Write($"Welcome {CurrentUserAccount.Name}..."); Console.WriteLine("\tLet's start to play"); Console.WriteLine(); } } else { Again(TryToLogIn); } }