Yes, both can be implemented.

I just said I will do type first and then reevaluate.

We actually could have both more-or-less. We really don't need size, but rather an

**ordering** (an ordered sequence) of

**size-types**. That is, sizes are just points,

*they are not additive*.

For some units, we need to have them confined to their type (e.g. vehicles need a garage, period). That could be done with a flag that would prevent these vehicles for being considered for higher size types.

For some units we may want to consider placement to into larger sized containers. A specific example would be placing two fighters into a spacedock (or it could be a transport ship dock). That could be done by setting the flag to confine to size to false.

With submarines and other entirely disjoint types, the key aspect is that these types are truly disjoint. Thus, it would suffice to introduce an additional parameter to designate the category. The land crafts could have 0 (which would include cars, confined to their garages, fighters that could inhabit larger hangars based on their type-size ordering, larger vessels and space-crafts residing in top-tier type-size). The submarine crafts could have 1. The difference here is:

- Categories are always disjoint.
- Type-sizes need not be disjoint. Some vehicles (like e.g. cars) could be confined to their type-size. (Note that this system doesn't forbid for e.g. Jeep to be confined to garage, while mudranger be eligible to both hangar and garage, if desired.)

I think this approach is very natural and covers almost all use cases that are encountered in practice.

Check out discussion at

https://openxcom.org/forum/index.php?topic=10870.msg165711#msg165711 as well.

My aim with designing these rules has been to avoid the pitfalls associated with the unrestricted assignment of subsets or intervals to hangars or vehicles. One of the relevant counterexamples is noted by the WarStalkeR at the

https://openxcom.org/forum/index.php?topic=10870.msg162989#msg162989. He spoke of pitfalls with assigning arbitrary subsets to hangars, but the same kind of problems and counter-examples arise when we assign arbitrary subsets to vehicles. In fact, the problem remains if we assign not just arbitrary subsets, but only arbitrary intervals to vehicles.

The only place where we may assign arbitrary subset (and it is highly desirable for this to be a subset rather than a wildcard, including all possible values) in the specifications is only when we have one hangar type with such assignment present at a base (e.g. two space-ports on a base that could take fighters and larger transports is feasible, and also at the same time another base could have a repair dock that may hold more craft types, but may either cost more or require a special workshop, etc.). What is important is that the types of multiple housing should not be mixed.

The dilemma is that there needs to be one base with hangar admitting multiple types (workshop base making fighters and heavy transports). It is not necessary to use the system of unrestricted sizes in order to have this, since both within the system of exclusive categories, sizes, and a system of sizes with per-vehicle optional category restrictions, it is still possible to have one type of hangars with explicit multi-vehicle configuration (that could admit an arbitrary subset of vehicle types).