Ejemplo n.º 1
0
        public static void ProcessCommand(string line)
        {
            string command   = TextUtils.ExtractCommand(line.Trim()).Trim().ToLower();
            string arguments = TextUtils.ExtractArguments(line.Trim()).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 "wherami":
                Player.GetCurrentRoom().ShowTitle();
                break;

            default:
                TextBuffer.Add("Input not understood");
                break;
            }
            GameManager.ApplyRules();
            TextBuffer.Display();
        }
Ejemplo n.º 2
0
 public static void StartGame()
 {
     Player.GetCurrentRoom().Describe();
     TextBuffer.Display();
 }