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

Function get_building_from_job

plugins/autolabor/joblabormapper.cpp:187–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185};
186
187static df::building* get_building_from_job(df::job* j)
188{
189 for (auto r = j->general_refs.begin(); r != j->general_refs.end(); r++)
190 {
191 if ((*r)->getType() == df::general_ref_type::BUILDING_HOLDER)
192 {
193 int32_t id = ((df::general_ref_building_holderst*)(*r))->building_id;
194 df::building* bld = binsearch_in_vector(world->buildings.all, id);
195 return bld;
196 }
197 }
198 return 0;
199}
200
201static df::unit_labor construction_build_labor(df::building_actual* b)
202{

Callers 3

get_laborMethod · 0.85
get_laborMethod · 0.85
get_laborMethod · 0.85

Calls 4

binsearch_in_vectorFunction · 0.85
getTypeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected