コード例 #1
0
ファイル: Units.cs プロジェクト: donkeyxdonkey/XtronV2
        public static PlayerClass SelectClass()
        {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            while (true)
            {
                for (int i = 0; i < Enum.GetNames(typeof(PlayerClass)).Length; i++)
                {
                    if (i == 0)
                    {
                        Console.Write("   >> ");
                        Console.ForegroundColor = ConsoleColor.DarkRed;
                        Console.WriteLine($"{(PlayerClass)i}");
                    }
                    else
                    {
                        Console.WriteLine($"      {(PlayerClass)i}");
                    }
                }

                var ReturnKeyOut = GameMenues.MenuBrowse(5, 3, 18, 25);
                if (ReturnKeyOut <= Enum.GetNames(typeof(PlayerClass)).Length)
                {
                    return((PlayerClass)ReturnKeyOut - 1);
                }
            }
        }
コード例 #2
0
        public void StartGame()
        {
            //STARTMENY
            GameMenues.GenerateHeader();

            var MenuSelect = GameMenues.StartMenuSelect();

            XtronFunctions.ClearLine(7);

            switch (MenuSelect)
            {
            case 1:
                Hero1 = new Player(Player.CorrectLetterOnlyInput(), Player.SelectClass());
                Console.WriteLine($"Player Name: {Hero1.Name} Class: {Hero1.PlayerClass} HP: {Hero1.HP}");
                break;

            case 2:

                break;

            case 3:

                break;
            }

            XtronFunctions.DelayStringWrite("Quack Quack Quack", 250);

            Console.ReadLine();
        }