From 0730fc3924dd4e04efbe51287d1d69850404d05f Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 31 Jan 2016 19:53:45 -0500 Subject: bump version to 0.5.0-rc1 * implements objects using reference counts rather than copying * implements both room-local and global verbs * refactors the world_* functions into a separate module * numerous other changes --- src/room.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/room.h') diff --git a/src/room.h b/src/room.h index 88de823..64cfeae 100644 --- a/src/room.h +++ b/src/room.h @@ -21,6 +21,7 @@ #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 @@ -49,13 +50,6 @@ struct roomdata_t { void (* const hook_leave)(room_id room, user_t *user); }; -struct verb_t { - const char *name; - - /* toks is strtok_r's pointer */ - void (*execute)(const char *toks, user_t *user); -}; - struct room_t { room_id id; struct roomdata_t data; @@ -69,11 +63,6 @@ struct room_t { }; /* room/world */ -void world_init(const struct roomdata_t *data, size_t sz, const char *name); -bool world_load(const char *fname, const struct roomdata_t *data, size_t data_sz, const char *world_name); -void world_save(const char *fname); - -struct room_t *room_get(room_id id); bool room_user_add(room_id id, struct child_data *child); bool room_user_del(room_id id, struct child_data *child); @@ -94,4 +83,15 @@ size_t room_obj_count(room_id room); bool room_obj_del(room_id room, const char *name); -void world_free(void); +/* local verbs override global verbs */ +bool room_verb_add(room_id room, struct verb_t*); +bool room_verb_del(room_id room, const char *verbname); + +/* get the local map of verbs */ +void *room_verb_map(room_id room); + +/* free a room and its resources */ +void room_free(struct room_t *room); + +/* semi-protected, should only be called from world_ */ +void room_init_maps(struct room_t *room); -- cgit v1.1