Shield_sys_types (the per-ship-class shield status in the FRED2/qtFRED Shield System dialog) was a dense array/vector sized to MAX_SHIP_CLASSES, one of the last cap-blocking structures. It is a poor fit for a dense container: it is derived, ephemeral editor state, and sparse in practice, since only the ship classes present in the mission ever get a meaningful value. Its default (HasShields) is exactly the "absent" case.
Convert it to a map keyed by ship class:
FRED2: int Shield_sys_types[MAX_SHIP_CLASSES] -> SCP_map<int, int>
qtFRED: SCP_vector<GlobalShieldStatus> Shield_sys_types -> SCP_map<int, GlobalShieldStatus>
(and the ShieldSystemDialogModel::_types copy likewise)
No file-format or behavior change: shield status is still derived from and applied to the same ship flags.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.