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

Method printItemDetails

library/modules/Job.cpp:171–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void DFHack::Job::printItemDetails(color_ostream &out, df::job_item *item, int idx)
172{
173 using std::endl;
174
175 CHECK_NULL_POINTER(item);
176
177 ItemTypeInfo info(item);
178 out << " Input Item " << (idx+1) << ": " << info.toString();
179
180 if (item->quantity != 1)
181 out << "; quantity=" << item->quantity;
182 if (item->min_dimension >= 0)
183 out << "; min_dimension=" << item->min_dimension;
184 out << endl;
185
186 MaterialInfo mat(item);
187 if (mat.isValid() || item->metal_ore >= 0) {
188 out << " material: " << mat.toString();
189 if (item->metal_ore >= 0)
190 out << "; ore of " << MaterialInfo(0,item->metal_ore).toString();
191 out << endl;
192 }
193
194 if (item->flags1.whole)
195 out << " flags1: " << bitfield_to_string(item->flags1) << endl;
196 if (item->flags2.whole)
197 out << " flags2: " << bitfield_to_string(item->flags2) << endl;
198 if (item->flags3.whole)
199 out << " flags3: " << bitfield_to_string(item->flags3) << endl;
200
201 if (!item->reaction_class.empty())
202 out << " reaction class: " << item->reaction_class << endl;
203 if (!item->has_material_reaction_product.empty())
204 out << " reaction product: " << item->has_material_reaction_product << endl;
205 if (item->has_tool_use >= (df::tool_uses)0)
206 out << " tool use: " << ENUM_KEY_STR(tool_uses, item->has_tool_use) << endl;
207}
208
209template <typename T>
210static void print_bitfield(color_ostream &out, T jsf) {

Callers

nothing calls this directly

Calls 5

MaterialInfoClass · 0.50
bitfield_to_stringFunction · 0.50
toStringMethod · 0.45
isValidMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected