From 205b1523012a0cb0bd81aa55370057df3884836c Mon Sep 17 00:00:00 2001 From: "Jason S. Ninneman" Date: Mon, 26 Jun 2017 15:23:51 -0700 Subject: [PATCH] Drop the vocabulary[] structure. --- newdungeon.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/newdungeon.py b/newdungeon.py index 6cc2c03..c7aabee 100755 --- a/newdungeon.py +++ b/newdungeon.py @@ -88,12 +88,6 @@ typedef struct {{ const char* hint; }} hint_t; -typedef struct {{ - const char* word; - const int type; - const int value; -}} vocabulary_t; - typedef struct {{ const char** words; }} motion_t; @@ -106,7 +100,6 @@ extern const turn_threshold_t turn_thresholds[]; extern const obituary_t obituaries[]; extern const hint_t hints[]; extern long conditions[]; -extern const vocabulary_t vocabulary[]; extern const long actspk[]; extern const motion_t motions[]; @@ -117,7 +110,6 @@ extern const motion_t motions[]; #define NDEATHS {} #define NTHRESHOLDS {} #define NVERBS {} -#define NVOCAB {} enum arbitrary_messages_refs {{ {} @@ -178,10 +170,6 @@ long conditions[] = {{ {} }}; -const vocabulary_t vocabulary[] = {{ -{} -}}; - const long actspk[] = {{ NO_MESSAGE, {} @@ -409,22 +397,6 @@ def recompose(type_word, value): sys.stderr.write("%s is not a known word classifier" % attrs["type"]) sys.exit(1) -def get_vocabulary(vocabulary): - template = """ {{ - .word = {}, - .type = {}, - .value = {}, - }}, -""" - voc_str = "" - for vocab in vocabulary: - word = make_c_string(vocab["word"]) - type_code = recompose(vocab["type"], vocab["value"]) - value = vocab["value"] - voc_str += template.format(word, type_code, value) - voc_str = voc_str[:-1] # trim trailing newline - return voc_str - def get_actspk(actspk): res = "" for (i, word) in actspk.items(): @@ -460,7 +432,6 @@ if __name__ == "__main__": get_obituaries(db["obituaries"]), get_hints(db["hints"], db["arbitrary_messages"]), get_condbits(db["locations"]), - get_vocabulary(db["vocabulary"]), get_actspk(db["actspk"]), get_motions(db["motions"]), ) @@ -473,7 +444,6 @@ if __name__ == "__main__": len(db["obituaries"]), len(db["turn_thresholds"]), len(db["actspk"]), - len(db["vocabulary"]), get_refs(db["arbitrary_messages"]), get_refs(db["locations"]), get_refs(db["objects"]),