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

Function df_counters

plugins/devel/counters.cpp:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace df::enums;
15
16command_result df_counters (color_ostream &out, vector <string> & parameters)
17{
18 df::unit *unit = Gui::getSelectedUnit(out);
19 if (!unit)
20 return CR_WRONG_USAGE;
21 auto &counters = unit->status.misc_traits;
22 for (size_t i = 0; i < counters.size(); i++)
23 {
24 auto counter = counters[i];
25 out.print("{} ({}) : {}\n", (int)counter->id, ENUM_KEY_STR(misc_trait_type, counter->id), counter->value);
26 }
27
28 return CR_OK;
29}
30
31DFHACK_PLUGIN("counters");
32

Callers

nothing calls this directly

Calls 3

getSelectedUnitFunction · 0.85
sizeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected