#ifndef ADVENTURE_H #define ADVENTURE_H #include #include "config.h" enum distance { dist_player, dist_held, dist_held_contained, dist_location, dist_here, dist_here_contained, dist_overthere, dist_not_here, dist_unknown_obj, dist_no_obj_specified, }; /* object.c */ #include "object.h" /* match.c */ #define MAX_PARAMS 26 struct param { const char *tag; struct object *object; enum distance distance; size_t count; }; extern struct param params[MAX_PARAMS]; #define param_by_letter(l) (params + (l) - 'A') int match_command(const char*, const char*); /* parseexec.h */ struct command { int (*fn)(void); const char *pattern; }; int exec_look_around(void); int parseexec(const char*); /* misc.c */ size_t list_objs_at_loc(struct object*); struct object *person_here(void); struct object *get_passage_to(struct object*); enum distance distance_to(struct object*); void move_player(struct object*); int weight_of_contents(struct object*); int object_within_reach(const char*, struct param*); /* io.c */ extern char *line; int getinput(); /* inventory.c */ int move_object(struct param*, struct object *from, struct object *to); /* toggle.c */ const char *cannot_be_opened(struct object*); const char *cannot_be_closed(struct object*); const char *cannot_be_locked(struct object*); const char *cannot_be_unlocked(struct object*); const char *is_already_open(struct object*); const char *is_already_closed(struct object*); const char *is_already_locked(struct object*); const char *is_already_unlocked(struct object*); const char *is_still_open(struct object*); const char *is_still_locked(struct object*); const char *toggle_backdoor(struct object*); const char *toggle_box(struct object*); const char *toggle_box_lock(struct object*); /* save.c */ int save(); int load(); #endif