Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 984 Bytes

README.md

File metadata and controls

49 lines (39 loc) · 984 Bytes

factbp

About

This library allows reading and writing factorio blueprint data. It supports reading and writing both the compressed format and just the json format.

This library will handle the differences in json format between reading and writing a single blueprint or a blueprint book containing nested blueprints or books.

Top level json element is either a single blueprint:

{
  "blueprint": {
    "item": "blueprint",
    "entities": []
  }
}

Or a book, where blueprints array is blueprints or nested books.

{
  "blueprint_book": {
    "item": "blueprint-book",
    "blueprints": [
      {
        "blueprint_book": {
          "item": "blueprint-book",
          "blueprints": [
          ]
        }
      },
      {
        "blueprint": {
          "item": "blueprint",
          "entities": []
        }
      }
    ]
  }
}

The Container struct handles reading and writing the top level object and the elements in the blueprints array.