Why don't you use bit groups for every sub-decision category? Computationally IS not much burden, as bit masks/bit shifts are computationally easy to manage.
Why complicate things, when 'std::vector<>' handling in C++ already does everything for you?
Maybe I understand something incorrectly, or maybe I'm simply wrong, but:
1/ we don't have a problem with space constraints, there is nothing forcing us to use bit maps, we can easily use numbers or even strings... and all 3 internal representations will have similar complexity (on the same order of magnitude)
2/ I assume your "single number" representation would allow all value combinations in all dimensions... in which case WarStalkeR's quick allocation algorithm wouldn't work, his algorithm poses constraints on the allowed combinations in order to not have to brute-force
(or if your representation poses same constraints, then I don't see the advantage over the solution he already implemented)
I already partially implemented slot grouping in my code (still not in the repository, as it is work in progress). And frankly, I feel like it is very, very, very bad idea already. And I will explain why.
Using this code, it is possible to group slots.
- type: STR_THAT_FANCY_HANGAR
crafts: 3
craftOptions:
- [-12, -12, 20, 49, false]
- [-12, -12, 2, 9, false]
- [14, -12, 20, 49, false]
- [14, -12, 2, 9, false]
- [1, 6, 20, 49, false]
optionGroups: [2, 2, 1]
It will group 1st and 2nd 'craftOptions' into group #1, 3rd and 4th into group #2 and 5th into group #3. When slots are grouped, only one of them is allowed to store craft. If craft is stored in 1st of group #1, 2nd slot won't be accessible.
All sounds great, until code attempts to sort them. For example, let's assume I already have one Jetbike (size 25) and one Bicycle (size 5). Despite logically being obvious that there is place for either new Jetbike or Bicycle, code will allow you to get only new Jetbike, because sorting code isn't that smart (it looks sorts by looking for a smallest slot for biggest ship). In addition, once you'll get another Jetbike, game will throw warning message that there are no free slots for Bicycle, because group #1 and group #2 are occupied Jetbikes.
Right now I'm looking into replacing this sorting function with one that utilizes heuristic-based approach, but it might be a little bit complicated and requires more testing, although it shouldn't increase computing complexity by much.
P.S. Meridian, please join Matrix chat, because some code discussions can accelerate process by much.