1 cc9bbf61 2020-04-01 op #ifndef ADVENTURE_H
2 cc9bbf61 2020-04-01 op #define ADVENTURE_H
4 cc9bbf61 2020-04-01 op #include <stddef.h>
6 3d4cf639 2020-04-03 op #include "config.h"
8 cc9bbf61 2020-04-01 op enum distance {
11 cc9bbf61 2020-04-01 op dist_held_contained,
12 cc9bbf61 2020-04-01 op dist_location,
14 cc9bbf61 2020-04-01 op dist_here_contained,
15 cc9bbf61 2020-04-01 op dist_overthere,
16 cc9bbf61 2020-04-01 op dist_not_here,
17 cc9bbf61 2020-04-01 op dist_unknown_obj,
18 cc9bbf61 2020-04-01 op dist_no_obj_specified,
21 cc9bbf61 2020-04-01 op /* object.c */
22 cc9bbf61 2020-04-01 op #include "object.h"
25 cc9bbf61 2020-04-01 op #define MAX_PARAMS 26
26 cc9bbf61 2020-04-01 op struct param {
27 cc9bbf61 2020-04-01 op const char *tag;
28 cc9bbf61 2020-04-01 op struct object *object;
29 cc9bbf61 2020-04-01 op enum distance distance;
32 cc9bbf61 2020-04-01 op extern struct param params[MAX_PARAMS];
33 cc9bbf61 2020-04-01 op #define param_by_letter(l) (params + (l) - 'A')
34 cc9bbf61 2020-04-01 op int match_command(const char*, const char*);
36 cc9bbf61 2020-04-01 op /* parseexec.h */
37 cc9bbf61 2020-04-01 op struct command {
38 cc9bbf61 2020-04-01 op int (*fn)(void);
39 cc9bbf61 2020-04-01 op const char *pattern;
41 cc9bbf61 2020-04-01 op int exec_look_around(void);
42 cc9bbf61 2020-04-01 op int parseexec(const char*);
45 cc9bbf61 2020-04-01 op size_t list_objs_at_loc(struct object*);
46 cc9bbf61 2020-04-01 op struct object *person_here(void);
47 cc9bbf61 2020-04-01 op struct object *get_passage_to(struct object*);
48 cc9bbf61 2020-04-01 op enum distance distance_to(struct object*);
49 cc9bbf61 2020-04-01 op void move_player(struct object*);
50 cc9bbf61 2020-04-01 op int weight_of_contents(struct object*);
51 cc9bbf61 2020-04-01 op int object_within_reach(const char*, struct param*);
54 cc9bbf61 2020-04-01 op extern char *line;
55 cc9bbf61 2020-04-01 op int getinput();
57 cc9bbf61 2020-04-01 op /* inventory.c */
58 cc9bbf61 2020-04-01 op int move_object(struct param*, struct object *from, struct object *to);
60 cc9bbf61 2020-04-01 op /* toggle.c */
61 cc9bbf61 2020-04-01 op const char *cannot_be_opened(struct object*);
62 cc9bbf61 2020-04-01 op const char *cannot_be_closed(struct object*);
63 cc9bbf61 2020-04-01 op const char *cannot_be_locked(struct object*);
64 cc9bbf61 2020-04-01 op const char *cannot_be_unlocked(struct object*);
66 cc9bbf61 2020-04-01 op const char *is_already_open(struct object*);
67 cc9bbf61 2020-04-01 op const char *is_already_closed(struct object*);
68 cc9bbf61 2020-04-01 op const char *is_already_locked(struct object*);
69 cc9bbf61 2020-04-01 op const char *is_already_unlocked(struct object*);
71 cc9bbf61 2020-04-01 op const char *is_still_open(struct object*);
72 cc9bbf61 2020-04-01 op const char *is_still_locked(struct object*);
74 cc9bbf61 2020-04-01 op const char *toggle_backdoor(struct object*);
75 cc9bbf61 2020-04-01 op const char *toggle_box(struct object*);
76 cc9bbf61 2020-04-01 op const char *toggle_box_lock(struct object*);