From 2c687e77cd9ae3fd01010d7b36c8d0082bb76315 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 20 Feb 2016 20:37:06 -0500 Subject: implements aliases and other assorted features/enhancements --- src/obj.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/obj.h') 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); -- cgit v1.1