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();
        }
Example #2
0
        private void Delete()
        {
            Console.Clear();

            ConsoleUI.AddHeader("Delete Save", ConsoleColor.Yellow);

            for (int i = 0; i < SaveManager.Instance.GetValidIndex().Length; i++)
            {
                int    index  = SaveManager.Instance.GetValidIndex()[i];
                string option = $"{SaveManager.Instance.GetSaveName(index)}";
                ConsoleUI.AddOption(option, $"{index}", ConsoleColor.Red);
            }


            SaveManager.Instance.DeleteAt(InputNumber());
            OnUpdateUI.Invoke();
        }
        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();
        }
        public override void DisplayUI()
        {
            Console.Clear();

            Console.WriteLine();

            ConsoleUI.AddHeader("Create a Character", ConsoleColor.Yellow);
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);
            Console.WriteLine();

            ConsoleUI.AddOption("Menu", "0", ConsoleColor.Red);
            ConsoleUI.AddOption("Set Name", "1", ConsoleColor.Green);
            ConsoleUI.AddOption("Set Class", "2", ConsoleColor.Magenta);

            Console.WriteLine();
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);
            Console.WriteLine();
        }
Example #5
0
        public override void DisplayUI()
        {
            Console.Clear();

            Console.WriteLine();

            ConsoleUI.AddHeader("Select a Character", ConsoleColor.Yellow);
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);

            Console.WriteLine();

            ConsoleUI.AddOption("Menu", "0", ConsoleColor.Red);

            for (int i = 0; i < SaveManager.Instance.GetSaveNames().Length; i++)
            {
                string name = SaveManager.Instance.GetSaveNames()[i];
                ConsoleUI.AddOption($"{name}", $"{SaveManager.Instance.GetSaveIndexOf(name)}", ConsoleColor.Cyan);
            }
            Console.WriteLine();
            ConsoleUI.DrawLine(30, "_", ConsoleColor.Yellow);
            Console.WriteLine();
        }