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

Function print_labor

plugins/autolabor/labormanager.cpp:1913–1937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1911}
1912
1913void print_labor(df::unit_labor labor, color_ostream &out)
1914{
1915 string labor_name = ENUM_KEY_STR(unit_labor, labor);
1916 out << labor_name << ": ";
1917 for (int i = 0; i < 20 - (int)labor_name.length(); i++)
1918 out << ' ';
1919 const auto& labor_info = labor_infos[labor];
1920 if (labor_info.is_unmanaged())
1921 {
1922 out << "UNMANAGED";
1923 }
1924 else
1925 {
1926 out << "priority " << labor_info.priority();
1927
1928 if (labor_info.maximum_dwarfs() == MAX_DWARFS_NONE)
1929 out << ", no maximum";
1930 else
1931 out << ", maximum " << labor_info.maximum_dwarfs();
1932 }
1933 out << ", currently " << labor_info.active_dwarfs << " dwarfs ("
1934 << labor_info.busy_dwarfs << " busy, "
1935 << labor_info.idle_dwarfs << " idle)"
1936 << endl;
1937}
1938
1939df::unit_labor lookup_labor_by_name(std::string name)
1940{

Callers 2

labormanagerFunction · 0.70
FOR_ENUM_ITEMSFunction · 0.70

Calls 4

lengthMethod · 0.80
is_unmanagedMethod · 0.80
priorityMethod · 0.80
maximum_dwarfsMethod · 0.45

Tested by

no test coverage detected