11 std::vector<party_info> result;
13 state.world.for_each_ideology([&](dcon::ideology_id ideology) {
14 auto loyalty = state.world.province_get_party_loyalty(prov_id, ideology);
16 result.push_back({ideology, loyalty, state.world.ideology_get_color(ideology)});
20 std::sort(result.begin(), result.end(), [&](
party_info a,
party_info b) { return a.loyalty > b.loyalty; });
26 uint32_t province_size = state.world.province_size();
27 uint32_t texture_size = province_size + 256 - province_size % 256;
29 std::vector<uint32_t> prov_color(texture_size * 2);
31 state.world.for_each_province([&](dcon::province_id prov_id) {
36 if(parties_info.size() == 0) {
38 prov_color[i] = 0xFFFFFF;
39 prov_color[i + texture_size] = 0xFFFFFF;
41 }
else if(parties_info.size() == 1) {
43 uint32_t color = parties_info[0].color;
44 prov_color[i] = color;
45 prov_color[i + texture_size] = color;
51 prov_color[i] = a.
color;
54 prov_color[i + texture_size] = b.
color;
56 prov_color[i + texture_size] = a.
color;
constexpr uint16_t to_map_id(dcon::province_id id)
std::vector< uint32_t > party_loyalty_map_from(sys::state &state)
std::vector< party_info > get_sorted_parties_info(sys::state &state, dcon::province_id prov_id)
dcon::ideology_id ideology