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

Function getActivityLabel

plugins/dwarfmonitor.cpp:176–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174static map<activity_type, string> activity_labels;
175
176static string getActivityLabel(const activity_type activity)
177{
178 string label;
179
180 if (activity_labels.find(activity) != activity_labels.end())
181 {
182 label = activity_labels[activity];
183 }
184 else
185 {
186 string raw_label = enum_item_key_str(static_cast<df::job_type>(activity));
187 for (auto c = raw_label.begin(); c != raw_label.end(); c++)
188 {
189 if (label.length() > 0 && *c >= 'A' && *c <= 'Z')
190 label += ' ';
191
192 label += *c;
193 }
194 }
195
196 return label;
197}
198
199
200class ViewscreenDwarfStats : public dfhack_viewscreen

Callers 3

getActivityItemMethod · 0.85
getFortAverageMethod · 0.85
getBreakdownAverageMethod · 0.85

Calls 5

enum_item_key_strFunction · 0.85
lengthMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected