aboutsummaryrefslogtreecommitdiff
path: root/src/obj.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-02-20 20:37:06 -0500
committerFranklin Wei <git@fwei.tk>2016-02-28 16:30:21 -0500
commit2c687e77cd9ae3fd01010d7b36c8d0082bb76315 (patch)
treeb8cd58cea075a3c94cb2f1417e6eaea27865b827 /src/obj.h
parent02de31c48c021742c6245b711790f6d853866c36 (diff)
downloadnetcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.zip
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.gz
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.bz2
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.xz
implements aliases and other assorted features/enhancements
Diffstat (limited to 'src/obj.h')
-rw-r--r--src/obj.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/obj.h b/src/obj.h
index c591009..249f9c1 100644
--- a/src/obj.h
+++ b/src/obj.h
@@ -60,6 +60,11 @@ struct obj_class_t {
typedef uint64_t obj_id;
+struct obj_alias_t {
+ char *alias;
+ struct obj_alias_t *next;
+};
+
/* world modules should not instantiate this directly, use obj_new() instead */
/* also, members marked with 'protected' should not be modified by the world module */
struct object_t {
@@ -72,7 +77,11 @@ struct object_t {
struct obj_class_t *class;
+ size_t n_alias;
+ struct obj_alias_t *alias_list;
+
bool list; /* whether to list in room view */
+ bool default_article; /* whether or not to use 'a' or 'an' when describing this */
void *userdata;
@@ -106,3 +115,6 @@ void obj_set_idcounter(obj_id);
/* compare two objects */
int obj_compare(const void *a, const void *b);
+
+/* count the number of non-alias objects in the given multimap */
+size_t obj_count_noalias(const void *multimap);