| 640 | } |
| 641 | |
| 642 | static command_result SetUnitLabors(color_ostream &stream, const SetUnitLaborsIn *in) |
| 643 | { |
| 644 | for (int i = 0; i < in->change_size(); i++) |
| 645 | { |
| 646 | auto change = in->change(i); |
| 647 | auto unit = df::unit::find(change.unit_id()); |
| 648 | |
| 649 | if (unit) |
| 650 | unit->status.labors[change.labor()] = change.value(); |
| 651 | } |
| 652 | |
| 653 | return CR_OK; |
| 654 | } |
| 655 | |
| 656 | CoreService::CoreService() : |
| 657 | suspend_depth{0}, |