aboutsummaryrefslogtreecommitdiff
path: root/src/room.h
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2016-01-31 19:53:45 -0500
committerFranklin Wei <frankhwei536@gmail.com>2016-01-31 19:53:45 -0500
commit0730fc3924dd4e04efbe51287d1d69850404d05f (patch)
tree495d79d0dc26e39c9065c6ceb7d16b9a3e76561d /src/room.h
parent8405274a91e3652ee98a423608a8496ead1edc05 (diff)
downloadnetcosm-0.5.0-rc1.zip
netcosm-0.5.0-rc1.tar.gz
netcosm-0.5.0-rc1.tar.bz2
netcosm-0.5.0-rc1.tar.xz
bump version to 0.5.0-rc10.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.h26
1 files changed, 13 insertions, 13 deletions
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);