Great news , i am planning that too , as you have understood .I will probably introduce a function in economy which can take care of all the timing and threading details.
To close ( from my side ) the chapter about CargoContainer , i just need to show you
that my logic isn't strange , and is well described even in your plan.md :
https://github.com/nido/vegastrike-mark ... c/plan2.md
To have this CargoHold class would have been a better design than the actual Cargo .Cargo
The principal unit we are working with is Cargo. Cargo has a type (for example, Iron Ore. Iron ore has a fixed volume and mass and category per unit; but different amounts of units may be owned by different entities. The player may have a pile of Hull Patches in his cargo bay, the fighter barracks may have a very small pile of Hull Patches and there may be a even bigger stack of it back at the factory where the player for it from. Each of these piles is a single Cargo.
Before the economy is integrated into vegastrike itself, it needs to be able to work with the player just sitting back, so forget any player involvement from this point on.
CargoHold
CargoHolds are 'containers' of multiple types of cargo. One example would be the cargo hold on the player ship, another the cargo available for trade at a base. Factories could have their own pools of cargo separate from the base trader. Cargo can be added to and deleted from a CargoHold as well as a Cargo Hold. Removing cargo by any of these methods will only work if all cargo can be removed. On success, that function returns true, on failure, it will return false.
But it is just my humble opinion .
Your implemention is actually ( following your plan):
Cargo is a CargoHold and cargoType a cargo .
Thank you for the details of ProductionOption , that are used finally just to setup
the factories .