ericmburgess / python-factorio

Factorio is a game about automation. Let's automate it.
MIT License
59 stars 9 forks source link

feature request: load from json #3

Open sparr opened 7 years ago

sparr commented 7 years ago

I would like to be able to load from the intermediate representation of a json string, rather than a native blueprint string. My use case is to make a repository of blueprint json files that can be collaboratively developed and improved.

ericmburgess commented 7 years ago

For now, you can do:bp=Blueprint(version_byte, json.loads(json_string))

It should have something nicer in the future, maybe auto-detection between a blueprint string, a JSON string, or nested data.

I'll probably take the version byte out of the constructor or at least make it optional, too.