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

Method printJobDetails

library/modules/Job.cpp:214–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214void DFHack::Job::printJobDetails(color_ostream &out, df::job *job)
215{
216 using std::endl;
217
218 CHECK_NULL_POINTER(job);
219
220 out.color(job->flags.bits.suspend ? COLOR_DARKGREY : COLOR_GREY);
221 out << "Job " << job->id << ": " << ENUM_KEY_STR(job_type,job->job_type);
222 if (job->flags.whole)
223 out << " (" << bitfield_to_string(job->flags) << ")";
224 out << endl;
225 out.reset_color();
226
227 df::item_type itype = ENUM_ATTR(job_type, item, job->job_type);
228
229 MaterialInfo mat(job);
230 if (itype == item_type::FOOD)
231 mat.decode(-1);
232
233 if (mat.isValid() || job->material_category.whole)
234 {
235 out << " material: " << mat.toString();
236 if (job->material_category.whole)
237 out << " (" << bitfield_to_string(job->material_category) << ")";
238 out << endl;
239 }
240
241 if (job->item_subtype >= 0 || job->specflag.whole)
242 {
243 ItemTypeInfo iinfo(itype, job->item_subtype);
244
245 out << " item: " << iinfo.toString();
246 switch (job->job_type) {
247 case df::job_type::ConstructBuilding: print_bitfield(out, job->specflag.construct_building_flags); break;
248 case df::job_type::CleanPatient: print_bitfield(out, job->specflag.clean_patient_flags); break;
249 case df::job_type::CleanSelf: print_bitfield(out, job->specflag.clean_self_flags); break;
250 case df::job_type::PlaceTrackVehicle: print_bitfield(out, job->specflag.place_track_vehicle_flags); break;
251 case df::job_type::GatherPlants: print_bitfield(out, job->specflag.gather_flags); break;
252 case df::job_type::Drink: print_bitfield(out, job->specflag.drink_item_flags); break;
253 case df::job_type::InterrogateSubject: print_bitfield(out, job->specflag.interrogation_flags); break;
254 case df::job_type::WeaveCloth: print_bitfield(out, job->specflag.weave_cloth_flags); break;
255 case df::job_type::CarveTrack: print_bitfield(out, job->specflag.carve_track_flags); break;
256 case df::job_type::LinkBuildingToTrigger: print_bitfield(out, job->specflag.link_building_to_trigger_flags); break;
257 case df::job_type::EncrustWithGems:
258 case df::job_type::EncrustWithGlass:
259 case df::job_type::EncrustWithStones:
260 print_bitfield(out, job->specflag.encrust_flags);
261 break;
262 default:
263 break;
264 }
265 out << endl;
266 }
267
268 if (job->specdata.hist_figure_id >= 0)
269 out << " figure: " << job->specdata.hist_figure_id << endl;
270
271 if (!job->reaction_name.empty())

Callers

nothing calls this directly

Calls 9

print_bitfieldFunction · 0.85
bitfield_to_stringFunction · 0.50
colorMethod · 0.45
reset_colorMethod · 0.45
decodeMethod · 0.45
isValidMethod · 0.45
toStringMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected