Example #1
0
        public override void DisplayUI()
        {
            Console.Clear();
            string[] menuList =
            {
                "Start Game",
                "Create Character",
                "Select Character",
                "Save",
                "Load",
                "Delete Save",
                "Display Characteristics"
            };

            Console.WriteLine();

            ConsoleUI.AddHeader("Menu", ConsoleColor.Yellow);
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);
            Console.WriteLine();
            ConsoleUI.AddOption("Quit", "0", ConsoleColor.Red);
            ConsoleUI.AddList(menuList, 1, ConsoleColor.Cyan);
            Console.WriteLine();
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);
            Console.WriteLine();
        }
        void SetClass()
        {
            Console.Clear();
            ConsoleUI.AddHeader("Select Class", ConsoleColor.Yellow);

            string[] classList =
            {
                "Warrior",
                "Mage",
                "Ranger",
                "Thief",
                "Priest",
                "Archer",
                "Orc",
                "Demon"
            };

            ConsoleUI.AddList(classList, 1, ConsoleColor.Cyan);

            CharacterClass characterClass = new Warrior();

            string classInput = Console.ReadLine();

            if (GetKeyInput(classInput, "1", "warrior"))
            {
                characterClass = new Warrior(250, 100, 100, 0);
            }
            else if (GetKeyInput(classInput, "2", "mage"))
            {
                characterClass = new Mage(200, 75, 75, 100);
            }
            else if (GetKeyInput(classInput, "3", "ranger"))
            {
                characterClass = new Ranger(200, 50, 100, 50);;
            }
            else if (GetKeyInput(classInput, "4", "thief"))
            {
                characterClass = new Thief(150, 50, 125, 75);
            }

            GameManager.Instance.PlayerCharacter.CharacterClass = characterClass;

            OnUpdateUI?.Invoke();
            ConsoleUI.Warning("You have selected : " + characterClass.GetType().Name);
            Console.WriteLine();
        }