diff options
| author | Franklin Wei <git@fwei.tk> | 2016-02-20 20:37:06 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-02-28 16:30:21 -0500 |
| commit | 159db44a2b2bbe5acd6d20f120e7c37deb286e66 (patch) | |
| tree | b8cd58cea075a3c94cb2f1417e6eaea27865b827 /src/obj.h | |
| parent | 19fa729506414f23c9c1fa4333e99f58a0a85c83 (diff) | |
| download | netcosm-159db44a2b2bbe5acd6d20f120e7c37deb286e66.zip netcosm-159db44a2b2bbe5acd6d20f120e7c37deb286e66.tar.gz netcosm-159db44a2b2bbe5acd6d20f120e7c37deb286e66.tar.bz2 netcosm-159db44a2b2bbe5acd6d20f120e7c37deb286e66.tar.xz | |
implements aliases and other assorted features/enhancements
Diffstat (limited to 'src/obj.h')
| -rw-r--r-- | src/obj.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |