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

Function popInvalidTasks

plugins/buildingplan/buildingplan_cycle.cpp:248–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248static df::building * popInvalidTasks(color_ostream &out, Bucket &task_queue,
249 unordered_map<int32_t, PlannedBuilding> &planned_buildings) {
250 while (!task_queue.empty()) {
251 auto & task = task_queue.front();
252 auto id = task.first;
253 if (planned_buildings.count(id) > 0) {
254 auto bld = planned_buildings.at(id).getBuildingIfValidOrRemoveIfNot(out);
255 if (bld && bld->jobs[0]->job_items.elements[task.second]->quantity)
256 return bld;
257 }
258 DEBUG(cycle,out).print("discarding invalid task: bld={}, job_item_idx={}\n", id, task.second);
259 task_queue.pop_front();
260 }
261 return NULL;
262}
263
264
265static int distance(df::coord pos1, df::coord pos2) {

Callers 1

doVectorFunction · 0.85

Calls 4

emptyMethod · 0.45
countMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected