@@ -676,8 +676,12 @@ bool CountryInstance::remove_unit_instance_group(UnitInstanceGroup const& group)
676676 const auto remove_from_vector = [this , &group]<unit_branch_t Branch>(
677677 memory::vector<UnitInstanceGroupBranched<Branch>*>& unit_instance_groups
678678 ) -> bool {
679- const typename memory::vector<UnitInstanceGroupBranched<Branch>*>::const_iterator it =
680- std::find (unit_instance_groups.begin (), unit_instance_groups.end (), &group);
679+ using const_it_t = typename memory::vector<UnitInstanceGroupBranched<Branch>*>::const_iterator;
680+ const const_it_t it = std::find (
681+ unit_instance_groups.begin (),
682+ unit_instance_groups.end (),
683+ &group
684+ );
681685
682686 if (it != unit_instance_groups.end ()) {
683687 unit_instance_groups.erase (it);
@@ -1226,12 +1230,14 @@ bool CountryInstance::apply_history_to_country(
12261230 ret &= add_reform (*reform);
12271231 }
12281232 set_optional_state (tech_school, entry.get_tech_school ());
1229- constexpr auto set_bool_map_to_indexed_map =
1230- []<typename T>(IndexedFlatMap<T, bool >& target, ordered_map<T const *, bool > source) {
1231- for (auto const & [key, value] : source) {
1232- target[*key] = value;
1233- }
1234- };
1233+ constexpr auto set_bool_map_to_indexed_map = []<typename T>(
1234+ IndexedFlatMap<T, bool >& target,
1235+ ordered_map<T const *, bool > source
1236+ ) {
1237+ for (auto const & [key, value] : source) {
1238+ target[*key] = value;
1239+ }
1240+ };
12351241
12361242 for (auto const & [technology, level] : entry.get_technologies ()) {
12371243 ret &= set_technology_unlock_level (*technology, level);
@@ -1466,9 +1472,9 @@ void CountryInstance::_update_technology(const Date today) {
14661472 }
14671473
14681474 daily_research_points += get_modifier_effect_value (*modifier_effect_cache.get_research_points ());
1469- daily_research_points *= fixed_point_t ::_1 +
1470- get_modifier_effect_value (*modifier_effect_cache.get_research_points_modifier ()) +
1471- get_modifier_effect_value (*modifier_effect_cache.get_increase_research ());
1475+ daily_research_points *= fixed_point_t ::_1
1476+ + get_modifier_effect_value (*modifier_effect_cache.get_research_points_modifier ())
1477+ + get_modifier_effect_value (*modifier_effect_cache.get_increase_research ());
14721478
14731479 if (daily_research_points.get_untracked () < 0 ) {
14741480 daily_research_points.set (0 );
@@ -1592,13 +1598,15 @@ void CountryInstance::_update_military() {
15921598
15931599 // Mobilisation calculations
15941600 mobilisation_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilization_impact ());
1595- mobilisation_economy_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_tech ()) +
1596- get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_country ());
1601+ mobilisation_economy_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_tech ())
1602+ + get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_country ());
15971603
15981604 // TODO - use country_defines.get_min_mobilize_limit(); (wiki: "lowest maximum of brigades you can mobilize. (by default 3)")
15991605
1600- mobilisation_max_regiment_count =
1601- ((fixed_point_t ::_1 + mobilisation_impact) * fixed_point_t::parse (regiment_count)).floor <size_t >();
1606+ mobilisation_max_regiment_count = (
1607+ (fixed_point_t ::_1 + mobilisation_impact)
1608+ * fixed_point_t::parse (regiment_count)
1609+ ).floor <size_t >();
16021610
16031611 mobilisation_potential_regiment_count = 0 ; // TODO - calculate max regiments from poor citizens
16041612 if (mobilisation_potential_regiment_count > mobilisation_max_regiment_count) {
@@ -1612,9 +1620,9 @@ void CountryInstance::_update_military() {
16121620 get_modifier_effect_value (*modifier_effect_cache.get_max_war_exhaustion ()), fixed_point_t ::_0
16131621 );
16141622
1615- organisation_regain = fixed_point_t ::_1 +
1616- get_modifier_effect_value (*modifier_effect_cache.get_org_regain ()) +
1617- get_modifier_effect_value (*modifier_effect_cache.get_morale_global ());
1623+ organisation_regain = fixed_point_t ::_1
1624+ + get_modifier_effect_value (*modifier_effect_cache.get_org_regain ())
1625+ + get_modifier_effect_value (*modifier_effect_cache.get_morale_global ());
16181626
16191627 land_organisation = fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_land_organisation ());
16201628 naval_organisation = fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_naval_organisation ());
@@ -1626,21 +1634,21 @@ void CountryInstance::_update_military() {
16261634
16271635 recruit_time = fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_unit_recruitment_time ());
16281636 combat_width = ( //
1629- fixed_point_t::parse (military_defines.get_base_combat_width ()) +
1630- get_modifier_effect_value (*modifier_effect_cache.get_combat_width_additive ())
1637+ fixed_point_t::parse (military_defines.get_base_combat_width ())
1638+ + get_modifier_effect_value (*modifier_effect_cache.get_combat_width_additive ())
16311639 ).floor <int32_t >();
16321640 dig_in_cap = get_modifier_effect_value (*modifier_effect_cache.get_dig_in_cap ()).floor <int32_t >();
1633- military_tactics = military_defines.get_base_military_tactics () +
1634- get_modifier_effect_value (*modifier_effect_cache.get_military_tactics ());
1641+ military_tactics = military_defines.get_base_military_tactics ()
1642+ + get_modifier_effect_value (*modifier_effect_cache.get_military_tactics ());
16351643
16361644 if (leadership_point_stockpile < 0 ) {
16371645 leadership_point_stockpile = 0 ;
16381646 }
16391647 create_leader_count = (leadership_point_stockpile / military_defines.get_leader_recruit_cost ()).floor <int32_t >();
16401648
16411649 monthly_leadership_points += get_modifier_effect_value (*modifier_effect_cache.get_leadership ());
1642- monthly_leadership_points *= fixed_point_t ::_1 +
1643- get_modifier_effect_value (*modifier_effect_cache.get_leadership_modifier ());
1650+ monthly_leadership_points *= fixed_point_t ::_1
1651+ + get_modifier_effect_value (*modifier_effect_cache.get_leadership_modifier ());
16441652
16451653 if (monthly_leadership_points < 0 ) {
16461654 monthly_leadership_points = 0 ;
@@ -1876,8 +1884,8 @@ void CountryInstance::update_gamestate(const Date today, MapInstance& map_instan
18761884 _update_politics ();
18771885 _update_diplomacy ();
18781886
1879- const CountryDefinition::government_colour_map_t ::const_iterator it =
1880- country_definition.get_alternative_colours ().find (government_type.get_untracked ());
1887+ using const_it_t = typename CountryDefinition::government_colour_map_t ::const_iterator;
1888+ const const_it_t it = country_definition.get_alternative_colours ().find (government_type.get_untracked ());
18811889
18821890 if (it != country_definition.get_alternative_colours ().end ()) {
18831891 colour = it.value ();
0 commit comments