Пример #1
0
        static void Play()
        {
            ColorPrint("Welcome to Dungeon Crawl.\n", ConsoleColor.Red);
            bool   exit  = false;
            string input = "";

            //List<string> inputList
            while (!exit)
            {
                ColorPrint($"HP >", ConsoleColor.Green);
                input = Console.ReadLine();
                var inputList = input.Split(' ');

                switch (inputList[0])
                {
                case "room":
                    Room.Display();
                    break;

                case "weapon":
                    Weapon.Display();
                    break;

                case "potion":
                    Potion.Display();
                    break;

                case "treasure":
                    Treasures.Display();
                    break;

                case "item":
                    Item.Display();
                    break;

                case "mob":
                    Mob.Display();
                    break;

                case "north":
                    Move("north");
                    break;

                case "south":
                    Move("south");
                    break;

                case "look":
                    PrintList(inputList[1]);
                    break;

                case "exit":
                    exit = true;
                    break;

                default:
                    Console.WriteLine("Command not found!");
                    break;
                }
            }
        }