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

Method process

plugins/autolabor/labormanager.cpp:1296–1866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294
1295public:
1296 void process()
1297 {
1298 if (*df::global::process_dig || *df::global::process_jobs)
1299 return;
1300
1301 release_dwarf_list();
1302
1303 dig_count = tree_count = plant_count = detail_count = 0;
1304 cnt_recover_wounded = cnt_diagnosis = cnt_immobilize = cnt_dressing = cnt_cleaning = cnt_surgery = cnt_suture =
1305 cnt_setting = cnt_traction = cnt_crutch = 0;
1306 need_food_water = 0;
1307
1308 labor_needed.clear();
1309
1310 for (int e = 0; e < TOOLS_MAX; e++)
1311 tool_count[e] = 0;
1312
1313 trader_requested = false;
1314
1315 FOR_ENUM_ITEMS(unit_labor, l)
1316 {
1317 if (l == df::unit_labor::NONE)
1318 continue;
1319
1320 labor_infos[l].active_dwarfs = labor_infos[l].busy_dwarfs = labor_infos[l].idle_dwarfs = 0;
1321 }
1322
1323 // scan for specific buildings of interest
1324
1325 scan_buildings();
1326
1327 // count number of squares designated for dig, wood cutting, detailing, and plant harvesting
1328
1329 count_map_designations();
1330
1331 // collect current job list
1332
1333 collect_job_list();
1334
1335 // count number of picks and axes available for use
1336
1337 count_tools();
1338
1339 // collect list of dwarfs
1340
1341 collect_dwarf_list();
1342
1343 // add job entries for designation-related jobs
1344
1345 labor_needed[df::unit_labor::MINE] += dig_count;
1346 labor_needed[df::unit_labor::CUTWOOD] += tree_count;
1347 labor_needed[df::unit_labor::DETAIL] += detail_count;
1348 labor_needed[df::unit_labor::HERBALIST] += plant_count;
1349
1350 // add job entries for health care
1351
1352 labor_needed[df::unit_labor::RECOVER_WOUNDED] += cnt_recover_wounded;
1353 labor_needed[df::unit_labor::DIAGNOSE] += cnt_diagnosis;

Callers 1

Calls 14

is_unmanagedMethod · 0.80
c_strMethod · 0.80
priorityMethod · 0.80
topMethod · 0.80
isOptionEnabledFunction · 0.70
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
printMethod · 0.45
emptyMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected