Ejemplo n.º 1
0
        public static void StartSetup()
        {
            Console.WriteLine("Welcome adventurer! Before we begin, what is your name?\n");
            var newName = Console.ReadLine(); // Await user input

            if (newName != "")
            {                   // Validate
                Name = newName; // Set username
            }
            else
            {
                Console.WriteLine("Sorry I didn't quite catch that, let's try again.");
                StartSetup();
            }

            Console.Clear();
            writeSlow($"Hello {Name}, I'm your guide on this adventure. I will try to interpret your words into actions in this game.\nI am the voice inside your head and more.");
            writeSlow($"\nLet's get this adventure started. It's a short one after all. Type in your catchphrase and let's go!\n");
            Catchphrase = Console.ReadLine();

            Console.Clear();
            if (Catchphrase.EndsWith("!") || Catchphrase.EndsWith(".")) // Validation
            {
                Catchphrase = Catchphrase.Remove(Catchphrase.Length - 1, 1);
            }
            writeSlow($"{Catchphrase}! I couldn't have said it better myself.");
        }
Ejemplo n.º 2
0
        public bool DeleteCatchphrase(Catchphrase catchphrase)
        {
            _dbcontext.Catchphrases.Remove(catchphrase);

            _dbcontext.SaveChanges();

            return(true);
        }