Beispiel #1
0
        public void NewGame()
        {
            var wb = new WorldBuilder();

            itemCollection = wb.CreateItems();
            roomCollection = wb.CreateRooms();
            CreateMap();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            ParseCommand parseCMD   = new ParseCommand();
            ExecuteCmd   executeCmd = new ExecuteCmd();

            World.CreateRooms();
            bool isValid = false;

            while (true)
            {
                Console.Clear();
                Player.ChangeLocation();
                //TODO: set this up to read next part of story
                currentRoom.DescribeRoom();

                //Console.SetCursorPosition(5, 20);
                Console.WriteLine("\n     Enter a command...: ");

                //Console.SetCursorPosition(5, 23);
                string input = Console.ReadLine();

                if (input.ToLower() == "exit")
                {
                    Console.WriteLine("\n          Thanks for playing");
                    Console.ReadKey();
                    break;
                }


                isValid = parseCMD.Validate(input);
                if (isValid)
                {
                    executeCmd.ProcessCmd(input);
                }
                else
                {
                    Console.WriteLine("\n    Sorry, Command " + input.ToUpper() + " is not recognized. Try again");
                    Console.ReadKey();
                }
            }
        }