X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=newdungeon.py;h=dffb8d142b0d58d136c6234ca7ddfe68e780ad12;hp=52380e6705c55a5774c15055c5d079eca892f084;hb=c8f6ff3701534e6c1ce59cf3e33aec5e824ed144;hpb=deb61e3dcd060dac685feb71aa21e52165fd8691 diff --git a/newdungeon.py b/newdungeon.py index 52380e6..dffb8d1 100755 --- a/newdungeon.py +++ b/newdungeon.py @@ -9,6 +9,8 @@ h_name = "newdb.h" c_name = "newdb.c" h_template = """/* Generated from adventure.yaml - do not hand-hack! */ +#ifndef NEWDB_H +#define NEWDB_H #include @@ -61,6 +63,7 @@ extern hint_t hints[]; extern const size_t CLSSES; extern const int maximum_deaths; extern const int turn_threshold_count; +#define HINT_COUNT {} enum arbitrary_messages_refs {{ {} @@ -74,7 +77,7 @@ enum object_descriptions_refs {{ {} }}; -/* end */ +#endif /* end NEWDB_H */ """ c_template = """/* Generated from adventure.yaml - do not hand-hack! */ @@ -253,6 +256,7 @@ if __name__ == "__main__": db = yaml.load(f) h = h_template.format( + len(db["hints"]), get_refs(db["arbitrary_messages"]), get_refs(db["locations"]), get_refs(db["object_descriptions"]),