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

Function shortJobDescription

plugins/workflow.cpp:1537–1556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535 ******************************/
1536
1537static std::string shortJobDescription(df::job *job)
1538{
1539 std::string rv = stl_sprintf("job %d: ", job->id);
1540
1541 if (job->job_type != job_type::CustomReaction)
1542 rv += ENUM_KEY_STR(job_type, job->job_type);
1543 else
1544 rv += job->reaction_name;
1545
1546 MaterialInfo mat;
1547 df::dfhack_material_category mat_mask;
1548 guess_job_material(job, mat, mat_mask);
1549
1550 if (mat.isValid())
1551 rv += " [" + mat.toString() + "]";
1552 else if (mat_mask.whole)
1553 rv += " [" + bitfield_to_string(mat_mask) + "]";
1554
1555 return rv;
1556}
1557
1558static void print_constraint(color_ostream &out, ItemConstraint *cv, bool no_job = false, std::string prefix = "")
1559{

Callers 2

setJobResumedFunction · 0.85
print_constraintFunction · 0.85

Calls 5

stl_sprintfFunction · 0.85
guess_job_materialFunction · 0.85
bitfield_to_stringFunction · 0.50
isValidMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected