diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-31 19:53:45 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-31 19:53:45 -0500 |
| commit | 7e223238ec9d6711290b1718c44cfe8158477b71 (patch) | |
| tree | 495d79d0dc26e39c9065c6ceb7d16b9a3e76561d /src/room.h | |
| parent | c87ef9230be5e52c9fa532ee0a3eba63960fc76d (diff) | |
| download | netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.zip netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.gz netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.bz2 netcosm-7e223238ec9d6711290b1718c44cfe8158477b71.tar.xz | |
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
Diffstat (limited to 'src/room.h')
| -rw-r--r-- | src/room.h | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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); |