| 528 | } |
| 529 | |
| 530 | static 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 |
no test coverage detected