Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SIM repo to include pop stat distributions #333

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions extension/src/openvic-extension/singletons/PopulationMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ Error MenuSingleton::_population_menu_update_filtered_pops() {

population_menu.workforce_distribution[pop->get_type()] += pop_size;
population_menu.religion_distribution[&pop->get_religion()] += pop_size;
population_menu.ideology_distribution += pop->get_ideologies() * pop_size;
population_menu.ideology_distribution += pop->get_ideology_distribution() * pop_size;
population_menu.culture_distribution[&pop->get_culture()] += pop_size;
population_menu.issue_distribution += pop->get_issues() * pop_size;
population_menu.vote_distribution += pop->get_votes() * pop_size;
population_menu.issue_distribution += pop->get_issue_distribution() * pop_size;
population_menu.vote_distribution += pop->get_vote_distribution() * pop_size;
}

normalise_fixed_point_map(population_menu.workforce_distribution);
Expand Down Expand Up @@ -455,11 +455,11 @@ MenuSingleton::sort_func_t MenuSingleton::_get_population_menu_sort_func(PopSort
};
case SORT_IDEOLOGY:
return [](Pop const* a, Pop const* b) -> bool {
return sorted_indexed_map_less_than(a->get_ideologies(), b->get_ideologies());
return sorted_indexed_map_less_than(a->get_ideology_distribution(), b->get_ideology_distribution());
};
case SORT_ISSUES:
return [](Pop const* a, Pop const* b) -> bool {
return sorted_fixed_map_less_than(a->get_issues(), b->get_issues());
return sorted_fixed_map_less_than(a->get_issue_distribution(), b->get_issue_distribution());
};
case SORT_UNEMPLOYMENT:
return [](Pop const* a, Pop const* b) -> bool {
Expand Down Expand Up @@ -684,8 +684,8 @@ TypedArray<Dictionary> MenuSingleton::get_population_menu_pop_rows(int32_t start
}
pop_dict[pop_militancy_key] = pop->get_militancy().to_float();
pop_dict[pop_consciousness_key] = pop->get_consciousness().to_float();
pop_dict[pop_ideology_key] = GFXPieChartTexture::distribution_to_slices_array(pop->get_ideologies());
pop_dict[pop_issues_key] = GFXPieChartTexture::distribution_to_slices_array(pop->get_issues());
pop_dict[pop_ideology_key] = GFXPieChartTexture::distribution_to_slices_array(pop->get_ideology_distribution());
pop_dict[pop_issues_key] = GFXPieChartTexture::distribution_to_slices_array(pop->get_issue_distribution());
pop_dict[pop_unemployment_key] = pop->get_unemployment().to_float();
pop_dict[pop_cash_key] = pop->get_cash().to_float();
pop_dict[pop_life_needs_key] = pop->get_life_needs_fulfilled().to_float();
Expand Down
Loading