AlexSatrapa / StarfieldOutpostCLI

A simple calculator to help build outposts in Starfield
Other
0 stars 0 forks source link

Group materials by type #18

Closed AlexSatrapa closed 6 months ago

AlexSatrapa commented 6 months ago

I tend to arrange my storage by type, so I'll have one row of boxes for solids, one row for liquids, one row for gasses, one row for manufactured items (warehouses). This means that a list of materials that is sorted alphabetically will have me bouncing between rows of storage to find the materials I want.

It would be nice to group materials by the type of storage they end up in, so aluminum and nickel would be grouped under "solid", ionic liquid and tasine would be grouped under "liquid", while isotopic coolant and substrate sieve would be under "manufactured". For example:

$ outpost bom
- 1 Wind Turbine - Advanced (14 power)
- 1 Animal Husbandry Facility (1 water, 2 fiber)
- 3 Storage - Solid - Large (2 fiber, 1 memory substrate)
- 1 Storage - Liquid - Large (water)
- 1 Landing Pad - Small

Bill of Materials:

- solid
  - Aluminum: 89
  - Iron: 80
  - Nickel: 16
  - Sealant: 3
- manufactured
  - Adaptive Frame: 45
  - Isocentered Magnet: 2
  - Reactive Gauge: 3

With the list organised like this I can go down my storage aisles and pick the things in the order that they appear.

"I am a bear of very little brain," said Pooh. I need things to be simple for my industry build so that I can get things done faster with fewer errors.

AlexSatrapa commented 6 months ago

Step 1: add "type" to all materials, based on types in the construction interface:

Step 2: modify "bom" method in materials.py to accept a boolean parameter "group by type" which will produce a two-level dict structure with the top level being the "type" of the material reported in the second level. The second level dict will be the same structure as the current output.