aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/PopulationMenu.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-17 01:01:03 +0200
committer hop311 <hop3114@gmail.com>2024-07-17 19:09:33 +0200
commit928c521599b2b18e8964aeb445c3ca5a55bacbd1 (patch)
treeaa6e018034c4c0fd498e74707d5cc3750c0dd438 /extension/src/openvic-extension/singletons/PopulationMenu.cpp
parent114394f4d1bcf5249089b6e3632d259a195ec584 (diff)
Use IndexedMap + helper function support
Diffstat (limited to 'extension/src/openvic-extension/singletons/PopulationMenu.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/PopulationMenu.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/extension/src/openvic-extension/singletons/PopulationMenu.cpp b/extension/src/openvic-extension/singletons/PopulationMenu.cpp
index 1237e86..db2ac53 100644
--- a/extension/src/openvic-extension/singletons/PopulationMenu.cpp
+++ b/extension/src/openvic-extension/singletons/PopulationMenu.cpp
@@ -407,12 +407,12 @@ void MenuSingleton::_population_menu_update_filtered_pops() {
population_menu.distributions[0][&pop->get_type()] += pop->get_size();
population_menu.distributions[1][&pop->get_religion()] += pop->get_size();
population_menu.distributions[2] +=
- cast_map<HasIdentifierAndColour>(pop->get_ideologies() * static_cast<int32_t>(pop->get_size()));
+ pop->get_ideologies() * static_cast<fixed_point_t>(static_cast<int32_t>(pop->get_size()));
population_menu.distributions[3][&pop->get_culture()] += pop->get_size();
population_menu.distributions[4] +=
cast_map<HasIdentifierAndColour>(pop->get_issues() * static_cast<int32_t>(pop->get_size()));
population_menu.distributions[5] +=
- cast_map<HasIdentifierAndColour>(pop->get_votes() * static_cast<int32_t>(pop->get_size()));
+ pop->get_votes() * static_cast<fixed_point_t>(static_cast<int32_t>(pop->get_size()));
}
for (fixed_point_map_t<HasIdentifierAndColour const*>& distribution : population_menu.distributions) {
@@ -467,7 +467,7 @@ MenuSingleton::sort_func_t MenuSingleton::_get_population_menu_sort_func(populat
};
case SORT_IDEOLOGY:
return [](Pop const* a, Pop const* b) -> bool {
- return sorted_fixed_map_less_than(a->get_ideologies(), b->get_ideologies());
+ return sorted_indexed_map_less_than(a->get_ideologies(), b->get_ideologies());
};
case SORT_ISSUES:
return [](Pop const* a, Pop const* b) -> bool {