Esempio n. 1
0
        public static void ProcessCommand(string line)
        {
            string command   = TextUtilils.ExtractCommand(line.Trim()).Trim().ToLower();
            string arguments = TextUtilils.ExtractArgueMent(line.Trim()).ToLower();

            switch (command)
            {
            case "exit":
                Program.Quit = true;
                return;

            case "help":
                ShowHelp();
                break;

            case "move":
                Player.Move(arguments);
                break;

            case "look":
                Player.GetCurrentRoom().Describe();
                break;

            case "pickup":
                Player.PickUpItem(arguments);
                break;

            case "drop":
                Player.DropItem(arguments);
                break;

            case "inventory":
                Player.DisplayInventory();
                break;

            case "whereami":
                Player.GetCurrentRoom().ShowTitle();
                break;

            default:
                TextBuffer.Add("Not a Valid Command");
                break;
            }
            GameManager.ApplyRules();
            TextBuffer.Display();
        }
Esempio n. 2
0
 public static void StartGame()
 {
     Player.GetCurrentRoom().Describe();
     TextBuffer.Display();
 }