Replace ore/gas fields with generic inventory containers #33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The resource catalog is data-driven, but GameState still stores rocks, gas, fleet_cargo, fleet_gas_cargo, stock, and gas_stock as separate fields. Generic-looking methods then switch on resource type throughout bank, fleet, building, logistics, and transfer code. Every new resource would require another field and edits across those paths.
Direction
Introduce a reusable Inventory container keyed by resource identifier. The mothership bank, fleet cargo, and building stock each own an Inventory and use generic deposit, withdraw, capacity, and transfer operations. Keep resource display metadata in ResourceDefinition entries so UI glyphs, names, colors, and formatting come from the same catalog.
Provide save/state migration or compatibility loading for current ore and gas values.
Acceptance criteria
Implemented in commit
1721edd.Changes:
Verification: