CleverRaven/Cataclysm-DDA — pull request #8411 by wormingdead (2014-08-02 21:22:44+00:00)
Title: [CR] Building Utility: Entirely reimplement acidia's Building-Utility

Building Utility no longer has hard coded file names, instead taking map ascii file and json templates from the command line. The program now uses the python standard libraries for json and argparse (command line interface) which unfortunately means the lowest version of python usable is 2.7/3.2. If this is unacceptable, it will probably be a significant amount of work to support older versions.

The program now uses json templates to know how to output json based on map cell information. There is an explanation for the template format at the command line (--help) and there are two examples based on the old input examples. The old output is still in 'output/' to compare. I don't think it's enough of an explanation, unfortunately. Let me know if you have trouble understanding it and I'll try to clarify.

Using the program: the command line takes a ascii cell map (drawing.txt) and one or more json templates (office_template.json) and outputs a json file per template. Each output file is a json list composed of templates per map cell with the appropriate substitutions. Some of the possible errors, (mostly from json formatting) have useful messages.

I tried to make the design easy to extend in sane ways, but since I am not a map creator, I don't know how well it will work for others. Critiques about use cases would be helpful.

Thanks