MCPcopy Create free account
hub / github.com/DFHack/dfhack / populateCategoryBreakdownColumn

Method populateCategoryBreakdownColumn

plugins/dwarfmonitor.cpp:831–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 void populateCategoryBreakdownColumn()
832 {
833 category_breakdown_column.clear();
834 if (fort_activity_column.getDisplayListSize() == 0)
835 return;
836
837 auto selected_activity = fort_activity_column.getFirstSelectedElem();
838 auto category_activities = &category_breakdown[selected_activity];
839 if (category_activities)
840 {
841 vector<pair<activity_type, size_t>> rev_vec(category_activities->begin(), category_activities->end());
842 sort(rev_vec.begin(), rev_vec.end(), less_second<activity_type, size_t>());
843
844 for (auto it = rev_vec.begin(); it != rev_vec.end(); ++it)
845 category_breakdown_column.add(getBreakdownAverage(it->first, it->second), it->first);
846 }
847
848 category_breakdown_column.fixWidth();
849 category_breakdown_column.clearSearch();
850 category_breakdown_column.setHighlight(0);
851 }
852
853 void addToFortAverageColumn(activity_type &type)
854 {

Callers

nothing calls this directly

Calls 10

sortFunction · 0.85
getDisplayListSizeMethod · 0.80
getFirstSelectedElemMethod · 0.80
fixWidthMethod · 0.80
clearSearchMethod · 0.80
setHighlightMethod · 0.80
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected