home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 353_02 / location.h < prev    next >
C/C++ Source or Header  |  1992-01-19  |  2KB  |  42 lines

  1. // This is the definition of the 19 different locations it is
  2. //  possible to enter.  This class contains an embedded object of
  3. //  class "items" to store the elements in each location.  The
  4. //  message is output automatically when the location is entered,
  5. //  and the look_message is output when the player gives the look
  6. //  command.
  7.  
  8.  
  9. #ifndef LOCATION_H
  10. #define LOCATION_H
  11.  
  12. #include "items.h"    // This gets the definition of the item list
  13.  
  14. class location {
  15.  
  16.    location *north_move;      // Where we go to, north of here
  17.    location *east_move;       // Where we go to, east of here
  18.    location *south_move;      // Where we go to, south of here
  19.    location *west_move;       // Where we go to, west of here
  20.    char *message;             // Message output when we enter here
  21.    char *look_message;        // The message output for a "look"
  22.    items list_of_items;       // The list of items in this location
  23.  
  24. public:
  25.  
  26.    void init(location *valid_north,  // These four directions are
  27.          location *valid_east,   //   initialized when init
  28.          location *valid_south,  //   is called.
  29.          location *valid_west,
  30.          char *local_message,
  31.          char *local_look_message);
  32.    location *move(word direction);   // Move to another location
  33.    void add_item(word item_to_add);  // This puts an item here
  34.    void drop_item(word item_to_drop);// Item picked up by player
  35.    char item_here(word item_to_check);// Is this item here?
  36.    void display_message(void);       // This displays the message
  37.    void display_list_of_items(void); // Display items found here
  38.                                      //  and a few room details.
  39. };
  40.  
  41. #endif
  42.