Add a Help command to display a list of possible commands

From TRCCompSci - AQA Computer Science
Revision as of 11:25, 18 December 2018 by Georgebarber (talk | contribs) (Created page with "=The Examine method= There is already a method to examine the inventory or an item so find this code: <syntaxhighlight lang=c#> private static void help() {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Examine method

There is already a method to examine the inventory or an item so find this code:

        private static void help()
        {
            Console.WriteLine("Commands: \n Get \n Use \n Go \n Read \n Examine \n Open \n Close \n Move \n Playdice \n Attack \n Quit");
            Console.ReadLine();
        }

Add more commands into the list as you make them. Then put the code below in the switch case:

                    case "help":
                        help();
                        break;