![]() The exits are labeled north, east, south, west. It is connected to other rooms via exits. It is used to recognise commands as they are typed in.Ī "Room" represents one location in the scenery of the game. This class holds an enumeration of all command words known to the game. If the command had only one word, then the second word is. If the user entered an invalid command (a word that is not known) then the command word is. The way this is used is: Commands are already checked for being valid command words. A command currently consists of two strings: a command word and a second word (for example, if the command was "take map", then the two strings obviously are "take" and "map"). This class holds information about a command that was issued by the user. It also evaluates and executes the commands that the parser returns. This main class creates and initialises all the others: it creates all rooms, creates the parser and starts the game. To play this game, create an instance of this class and call the "play" method. This class is the main class of the "World of Zuul" application. It checks user input against the known commands, and if the input is not one of the known commands, it returns a command object that is marked as an unknown command. The parser has a set of known command words. It returns the command as an object of class Command. Every time it is called it reads a line from the terminal and tries to interpret the line as a two word command. This parser reads user input and tries to interpret it as an "Adventure" command. The descriptions below are taken from the documentation in the source code of the classes Directions can be one of these: north, east, south, and west. Go "somewhere": Goes through the door in the specified direction. Help: Gives information about the commands available "World of Zuul" is a very simple, text based adventure game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |