Example #1
0
        public void Update()
        {
            var input  = console.ReadLine().ToUpper();
            var choice = races.FirstOrDefault(n => n.Name.ToUpper() == input);

            if (choice == null)
            {
                if (input == "INFO")
                {
                    console.WriteLine("Burklax", ConsoleColor.Yellow, ConsoleColor.DarkRed);
                }
                else
                {
                    Environment.Exit(0);
                }
            }
            else
            {
                console.Clear(); //Clears the screen
                console.WriteLine(choice.Name, ConsoleColor.DarkGreen);
                console.WriteLine($@"Stats: 
Hp: {choice.Health}
Attack: {choice.Attack}
Energy: {choice.Energy}

Spells:");
                foreach (var spell in choice.Spells)
                {
                    console.WriteLine(spell.ToString());
                }


                console.Render();//future proof for off screen buffering
                console.ReadKey();
                console.Clear();
                Program.GameState = new Combat(choice);
                Program.GameState.Setup();
            }
        }