function checkSectorAllowedForLoc(SmrSector &$sector, SmrLocation &$location) { if (!$location->isHQ()) { return sizeof($sector->getLocations()) < 4 && !$sector->offersFederalProtection(); } else { //HQs are here //find a sector where there are no locations yet return !$sector->hasLocation(); } }