From ed95a5621ac9c4f5002e68a981f8b24d5caaedf4 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 28 Mar 2016 14:11:22 -0400 Subject: kludge things to compile on old linux --- src/room.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/room.h') diff --git a/src/room.h b/src/room.h index e9e1953..c0304c7 100644 --- a/src/room.h +++ b/src/room.h @@ -20,15 +20,14 @@ #include "globals.h" -#include "obj.h" -#include "verb.h" - /* Our world is an array of rooms, each having a list of objects in - them, as well as actions that can be performed in the room. Objects - are added by hooks in rooms, which are provided by the world - module. */ + * them, as well as actions that can be performed in them + * (verbs). Objects are added by hooks in rooms, which are provided as + * function pointers by the world module. */ -typedef struct child_data user_t; // definition of child_data in server.h +struct child_data; +struct object_t; +struct verb_t; typedef enum room_id { ROOM_NONE = -1 } room_id; @@ -43,6 +42,7 @@ struct roomdata_t { char *name; char *desc; + /* unmutable properties, changes will have no effect */ const char * const adjacent[NUM_DIRECTIONS]; void (* const hook_init)(room_id id); @@ -50,8 +50,12 @@ struct roomdata_t { /* return values indicate permission to enter/leave, * setting to NULL defaults to true. */ - bool (* const hook_enter)(room_id room, user_t *user); - bool (* const hook_leave)(room_id room, user_t *user); + + /* NOTE: struct child_data is aliased as "user_t"!!! */ + + /* return false to deny entering/leaving a room */ + bool (* const hook_enter)(room_id room, struct child_data *user); + bool (* const hook_leave)(room_id room, struct child_data *user); void (* const hook_serialize)(room_id room, int fd); void (* const hook_deserialize)(room_id room, int fd); void (* const hook_destroy)(room_id room); -- cgit v1.1