Then there's the edge case of banning every hulls belonging to a role and there's no fallback anymore...
Definitely a valid edge case. But what if the logic just checked the Frequency array/map/w.e for non-zero values and kept an active count in memory per each ship role? That way whenever the "disable" button is pressed it can assess whether this would violate the "count must be greater than 0" rule and deny the hull from being disabled if so? Unless the iterations would cause noticeable lag between click and action that could work.
*Player presses disable on the hull*
Pseudo code:
Object emptyRole = noRolesEmpty(hullId);
if (frequencyMap.get(hullId) != 0 && emptyRole.validateNoEmptyRoles() {
allowHullDisabled(hullId);
} else if (frequencyMap.get(hullId) == 0) {
displayMessageHullAlreadyDisabled(hullId);
} else {
displayMessageEmptyRoleViolation(emptyRole.getEmptyRoleString());
}
Of course, that would mean more UI work and eventually there would be some desire for role status to be explicitly shown in the UI so the player can keep track of how many potential hulls are in each particular role.
Alternatively, an intel report could be generated only if a role is empty and a fleet would have otherwise spawned one but doesn't have a fallback. That would probably be easier to do with the existing code base since intel reports are already a thing and the additional logic would just have to check that the role in question has a non-zero value in the map during fleet creation or it spawns a report for that role.
The way to remove the report would be to activate a hull in the corresponding role. To prevent UI work to show role-hull candidacy in the management screen, the report could list all the available hulls for the empty role so the player knows what their options are.
To prevent spam, reports aren't duplicated. As long as a report exists for that role, no new reports are generated until the player resolves the first one by enabling a valid hull.
Idk, just some random brainstorming. I agree that more player faction fleet management would be really nice.