aboutsummaryrefslogtreecommitdiff
path: root/src/room.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-03-28 14:11:22 -0400
committerFranklin Wei <git@fwei.tk>2016-03-31 17:09:36 -0400
commited95a5621ac9c4f5002e68a981f8b24d5caaedf4 (patch)
treeaee87cf74280e8f9dd29aca88d12a638f37b2493 /src/room.h
parent13052597a19fd2212efb7f51f19ed73b9f4b6ba4 (diff)
downloadnetcosm-ed95a5621ac9c4f5002e68a981f8b24d5caaedf4.zip
netcosm-ed95a5621ac9c4f5002e68a981f8b24d5caaedf4.tar.gz
netcosm-ed95a5621ac9c4f5002e68a981f8b24d5caaedf4.tar.bz2
netcosm-ed95a5621ac9c4f5002e68a981f8b24d5caaedf4.tar.xz
kludge things to compile on old linux
Diffstat (limited to 'src/room.h')
-rw-r--r--src/room.h22
1 files changed, 13 insertions, 9 deletions
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);