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

Function lookup_labor_by_name

plugins/autolabor/labormanager.cpp:1939–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1937}
1938
1939df::unit_labor lookup_labor_by_name(std::string name)
1940{
1941 // We should accept incorrect casing, there is no ambiguity.
1942 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
1943
1944 FOR_ENUM_ITEMS(unit_labor, test_labor)
1945 {
1946 if (name == ENUM_KEY_STR(unit_labor, test_labor))
1947 {
1948 return test_labor;
1949 }
1950 }
1951
1952 return df::unit_labor::NONE;
1953}
1954
1955DFhackCExport command_result plugin_enable(color_ostream &out, bool enable)
1956{

Callers 1

labormanagerFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected