8template<
typename T,
typename U>
10 auto is_accepted = ve::apply(
11 [&state](dcon::nation_id n, dcon::culture_id c) {
13 return state.world.nation_get_accepted_cultures(n, c);
18 return (state.world.nation_get_primary_culture(ids) == cul_ids) || is_accepted;
23 auto cultures = state.world.nation_get_primary_culture(ids);
24 return state.world.culture_get_group_from_culture_group_membership(cultures);
29 auto location = state.world.pop_get_province_from_pop_location(pop_ids);
30 return state.world.province_get_nation_from_province_ownership(location);
35 auto cpc =
ve::to_float(state.world.nation_get_central_ports(ids));
36 auto b_count =
ve::to_float(state.world.nation_get_central_blockaded(ids));
37 auto ret =
decltype(cpc){};
38 return ve::select(cpc != 0.0f, b_count / cpc, ret);
43 auto cpc =
ve::to_float(state.world.nation_get_central_province_count(ids));
44 auto reb_count =
ve::to_float(state.world.nation_get_central_rebel_controlled(ids));
45 return ve::select(cpc != 0.0f, reb_count / cpc,
decltype(cpc)());
50 auto cpc =
ve::to_float(state.world.nation_get_central_province_count(ids));
51 auto crim_count =
ve::to_float(state.world.nation_get_central_crime_count(ids));
52 return ve::select(cpc != 0.0f, crim_count / cpc,
decltype(cpc)());
57 auto cpc =
ve::to_float(state.world.nation_get_owned_province_count(ids));
58 auto occ_count =
ve::to_float(state.world.nation_get_occupied_count(ids));
59 return ve::select(cpc != 0.0f, occ_count / cpc,
decltype(cpc)());
auto central_reb_controlled_fraction(sys::state const &state, T ids)
auto occupied_provinces_fraction(sys::state const &state, T ids)
auto primary_culture_group(sys::state const &state, T ids)
dcon::nation_id owner_of_pop(sys::state const &state, dcon::pop_id pop_ids)
auto central_blockaded_fraction(sys::state const &state, T ids)
auto central_has_crime_fraction(sys::state const &state, T ids)
auto nation_accepts_culture(sys::state const &state, T ids, U cul_ids)
T select(bool v, T a, T b)
float to_float(int32_t a)