tvwenger / du-factory-generator

https://tvwenger.github.io/du-factory-generator/
MIT License
14 stars 30 forks source link

Add Factory Save Feature #19

Closed tvwenger closed 4 years ago

tvwenger commented 4 years ago

Add a feature to download the factory plan as JSON (or some other format).

tvwenger commented 4 years ago

Implements saving of factory to JSON, loading a factory from JSON, and adding new production lines onto an existing factory.

tvwenger commented 4 years ago

I made the suggested changes. I added a new feature:

When starting from an existing factory and adding more assemblers for an item that's already in the factory's output, send the output of the new assemblers to the same output node if possible.

I also fixed two bugs:

  1. Adding production lines for catalysts can add upstream production of byproducts. Since byproduct handling happened before catalyst handling, there were some byproducts that weren't being handled. This is fixed now.

  2. There was a bug with how container egress was being calculated for TransferNode consumers outputing to a TransferContainerNode. Before, I was assuming that the TransferNode drew equally from each input. This is a poor assumption because some input containers might be fed by more industries than another input container. Now, I keep track of what the container's egress to the industry was before it was moved into the TransferNode and TransferContainerNode.