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

Function do_cycle

plugins/preserve-rooms.cpp:530–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530static void do_cycle(color_ostream &out) {
531 cycle_timestamp = world->frame_counter;
532
533 TRACE(cycle,out).print("running {} cycle\n", plugin_name);
534
535 if (config.get_bool(CONFIG_TRACK_MISSIONS)) {
536 unordered_set<int32_t> active_unit_ids;
537 std::transform(world->units.active.begin(), world->units.active.end(),
538 std::inserter(active_unit_ids, active_unit_ids.end()), [](auto & unit){ return unit->id; });
539
540 process_rooms(out, active_unit_ids, last_known_assignments_bedroom, world->buildings.other.ZONE_BEDROOM);
541 process_rooms(out, active_unit_ids, last_known_assignments_office, world->buildings.other.ZONE_OFFICE);
542 process_rooms(out, active_unit_ids, last_known_assignments_dining, world->buildings.other.ZONE_DINING_HALL);
543 process_rooms(out, active_unit_ids, last_known_assignments_tomb, world->buildings.other.ZONE_TOMB, false);
544
545 DEBUG(cycle,out).print("tracking zone assignments: bedrooms: {}, offices: {}, dining halls: {}, tombs: {}\n",
546 last_known_assignments_bedroom.size(), last_known_assignments_office.size(),
547 last_known_assignments_dining.size(), last_known_assignments_tomb.size());
548
549 scrub_reservations(out);
550 }
551
552 if (config.get_bool(CONFIG_TRACK_ROLES)) {
553 assign_nobles(out);
554 }
555}
556
557/////////////////////////////////////////////////////
558// Event logic

Callers 4

preserve_rooms_cycleFunction · 0.70

Calls 7

process_roomsFunction · 0.85
scrub_reservationsFunction · 0.85
assign_noblesFunction · 0.85
printMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected