home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / d-linux.zip / dm-dist / doc / handler.doc < prev    next >
Text File  |  1991-03-01  |  3KB  |  80 lines

  1. /* ************************************************************************
  2. *  Copyright (C) 1990, 1991 - see 'license.doc' for complete information. *
  3. ************************************************************************* */
  4.  
  5. Description of module 'handler.c'.
  6.  
  7. *** Note: All the routines that takes something away from something assumes
  8. that something is actually in/carried by something!
  9.  
  10. void char_from_room(struct char_data *ch)
  11. Removes ch from whatever room he's in.
  12.  
  13. void char_to_room(struct char_data *ch, int room)
  14. Places ch in room.
  15.  
  16. void object_to_char(struct obj_data *object, struct char_data *ch)
  17. Gives object to ch.
  18.  
  19. void object_from_char(struct obj_data *object)
  20. Takes object away from The character who is carrying it.
  21.  
  22. struct obj_data *find_object_in_list(char *name, struct obj_data *list)
  23. This procedure assumes that list points to the head of a content-list of
  24. objects. It then tries to locate the object with a given name within that
  25. list. If succesful, the function returns a pointer to that object; if not,
  26. it returns a null pointer.
  27.  
  28. struct obj_data *find_obj(char *name)
  29. This function searches the 'global' list of objects (pointed to by 
  30. 'object_list') for an object with a given name. It then returns either
  31. a null pointer or a pointer to that object (note that in this version,
  32. it will always return the first occurence of an object with a given name).
  33.  
  34. struct char_data *get_char_room(char *name, int room)
  35. Searches room for character with 'name'. Returns null or pointer to that
  36. character.
  37.  
  38. struct char_data *get_char(char *name)
  39. Searches the entire world for a character. Assumes that all characters are
  40. in a list pointed to by character_list (This might need changing).
  41.  
  42. void object_to_room(struct obj_data *object, int room)
  43. Puts an object in a room.
  44.  
  45. void object_from_room(struct obj_data *object)
  46.  
  47. void object_to_object(struct obj_data *obj, *obj_to)
  48.  
  49. void object_from_object(struct obj_data *obj, *obj_from)
  50.  
  51. void extract_char(struct char_data *ch)
  52. Extracts a character completely from the world, and leaves his stuff in
  53. the room (might be useful.. might not..).
  54.  
  55.  
  56. **** Higher level versions of the 'find' routines.
  57. These routines work like the above versions, with the exception that they are
  58. supplied with a pointer to a character as well as a keyword to look for. they 
  59. then return nil if they fail to locate the object/character OR if the character
  60. 'using' the routine can't see the searched-for object/character.
  61.  
  62.  
  63.  
  64.  
  65. struct char_data *get_char_room_vis(struct char_data *ch, char *name)
  66.  
  67.  
  68.  
  69. struct char_data *get_char_vis(struct char_data *ch, char *name)
  70.  
  71.  
  72.  
  73. struct obj_data *find_object_in_list_vis(struct char_data *ch, char *name,
  74.                                 struct obj_data *list)
  75.  
  76.  
  77.  
  78. /*search the entire world for an object, and return a pointer  */
  79. struct obj_data *find_obj_vis(struct char_data *ch, char *name)
  80.