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

Function get_vector_ids

plugins/buildingplan/plannedbuilding.cpp:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace DFHack;
20
21static vector<vector<df::job_item_vector_id>> get_vector_ids(color_ostream &out, int bld_id) {
22 vector<vector<df::job_item_vector_id>> ret;
23
24 df::building *bld = df::building::find(bld_id);
25
26 if (!bld || bld->jobs.size() != 1)
27 return ret;
28
29 auto &jitems = bld->jobs[0]->job_items.elements;
30 int num_job_items = (int)jitems.size();
31 for (int jitem_idx = num_job_items - 1; jitem_idx >= 0; --jitem_idx) {
32 ret.emplace_back(getVectorIds(out, jitems[jitem_idx], false));
33 }
34 return ret;
35}
36
37static vector<vector<df::job_item_vector_id>> deserialize_vector_ids(color_ostream &out, PersistentDataItem &bld_config) {
38 vector<vector<df::job_item_vector_id>> ret;

Callers 2

deserialize_vector_idsFunction · 0.85
PlannedBuildingMethod · 0.85

Calls 3

getVectorIdsFunction · 0.85
findFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected