Documentation and polishing.

This commit is contained in:
Eric S. Raymond 2017-06-21 11:45:16 -04:00
parent ddb0df85b3
commit c3a71f6db6
2 changed files with 22 additions and 8 deletions

View file

@ -33,6 +33,10 @@
# If the inventory desription begins with "*" the object is dungeon # If the inventory desription begins with "*" the object is dungeon
# furniture that cannot be taken or carried. # furniture that cannot be taken or carried.
# #
# obituaries: Death messages abd reincarnation queries. Order is
# significant, they're used in succession as the player racks up
# deaths.
#
# hints: Each item contains a hint number (add 10 to get cond bit), # hints: Each item contains a hint number (add 10 to get cond bit),
# the number of turns he must be at the right loc(s) before # the number of turns he must be at the right loc(s) before
# triggering the hint, the points deducted for taking the hint, the # triggering the hint, the points deducted for taking the hint, the

View file

@ -8,7 +8,9 @@ yaml_name = "adventure.yaml"
h_name = "newdb.h" h_name = "newdb.h"
c_name = "newdb.c" c_name = "newdb.c"
h_template = """#include <stdio.h> h_template = """/* Generated from adventure.yaml - do not hand-hack! */
#include <stdio.h>
typedef struct {{ typedef struct {{
const char* inventory; const char* inventory;
@ -56,9 +58,9 @@ extern turn_threshold_t turn_thresholds[];
extern obituary_t obituaries[]; extern obituary_t obituaries[];
extern hint_t hints[]; extern hint_t hints[];
extern size_t CLSSES; extern const size_t CLSSES;
extern int maximum_deaths; extern const int maximum_deaths;
extern int turn_threshold_count; extern const int turn_threshold_count;
enum arbitrary_messages_refs {{ enum arbitrary_messages_refs {{
{} {}
@ -71,9 +73,13 @@ enum locations_refs {{
enum object_descriptions_refs {{ enum object_descriptions_refs {{
{} {}
}}; }};
/* end */
""" """
c_template = """#include "{}" c_template = """/* Generated from adventure.yaml - do not hand-hack! */
#include "{}"
const char* arbitrary_messages[] = {{ const char* arbitrary_messages[] = {{
{} {}
@ -103,9 +109,11 @@ hint_t hints[] = {{
{} {}
}}; }};
size_t CLSSES = {}; const size_t CLSSES = {};
int maximum_deaths = {}; const int maximum_deaths = {};
int turn_threshold_count = {}; const int turn_threshold_count = {};
/* end */
""" """
def make_c_string(string): def make_c_string(string):
@ -269,3 +277,5 @@ if __name__ == "__main__":
with open(c_name, "w") as cf: with open(c_name, "w") as cf:
cf.write(c) cf.write(c)
# end