Unlike most generators, this one had a large JS section that can more or less be ported directly over. It's the json connection that is the problem.
The only problem is the json data being passed to JS was based on a perl data structure that isn't easily replicable in Python. This gives us three options:
Bend over backwards to implement the perl data structure with no changes to the JS.
Rewrite the JS to fit with the current python data being returned.
In addition, the data structure on the backend greatly changed between CityGenerator and Megacosm Generator with the xml-> data file conversion. I no longer have the simplicity of nested data structures to represent different patterns.
This whole thing should potentially be gutted and recreated :)
I was able to rework a good deal of this, however there's still plenty of room for improvement. Borders are still missing, as are asterisk and jacks. The template page currently does not show the seed, either.
My goal is to eventually get back to the multi-flag view that citygenerator had:
http://citygenerator.morgajel.net/multiflaggenerator
Unlike most generators, this one had a large JS section that can more or less be ported directly over. It's the json connection that is the problem.
The only problem is the json data being passed to JS was based on a perl data structure that isn't easily replicable in Python. This gives us three options:
I had begun the work in the flag branch ( https://github.com/CityGenerator/Megacosm-Generator/tree/feature/flags ) but quickly grew tired as I realized how messy the code was and how much I worked around what perl was sending me.
In addition, the data structure on the backend greatly changed between CityGenerator and Megacosm Generator with the xml-> data file conversion. I no longer have the simplicity of nested data structures to represent different patterns.
This whole thing should potentially be gutted and recreated :)