| 612 | } |
| 613 | |
| 614 | static command_result ListSquads(color_ostream &stream, |
| 615 | const ListSquadsIn *in, ListSquadsOut *out) |
| 616 | { |
| 617 | auto entity = df::historical_entity::find(df::global::plotinfo->group_id); |
| 618 | if (!entity) |
| 619 | return CR_NOT_FOUND; |
| 620 | |
| 621 | for (size_t i = 0; i < entity->squads.size(); i++) |
| 622 | { |
| 623 | auto squad = df::squad::find(entity->squads[i]); |
| 624 | if (!squad) |
| 625 | continue; |
| 626 | |
| 627 | auto item = out->add_value(); |
| 628 | item->set_squad_id(squad->id); |
| 629 | |
| 630 | if (squad->name.has_name) |
| 631 | describeName(item->mutable_name(), &squad->name); |
| 632 | if (!squad->alias.empty()) |
| 633 | item->set_alias(squad->alias); |
| 634 | |
| 635 | for (size_t j = 0; j < squad->positions.size(); j++) |
| 636 | item->add_members(squad->positions[j]->occupant); |
| 637 | } |
| 638 | |
| 639 | return CR_OK; |
| 640 | } |
| 641 | |
| 642 | static command_result SetUnitLabors(color_ostream &stream, const SetUnitLaborsIn *in) |
| 643 | { |
nothing calls this directly
no test coverage detected