abuse WatchedRace struct for counting stocks (since it sorts by gender and age) calling method must delete pointer!
| 752 | // abuse WatchedRace struct for counting stocks (since it sorts by gender and age) |
| 753 | // calling method must delete pointer! |
| 754 | static WatchedRace * checkRaceStocksTotal(color_ostream &out, int race) { |
| 755 | WatchedRace * w = new WatchedRace(out, race, true, 0, 0, 0, 0); |
| 756 | for (auto unit : world->units.active) { |
| 757 | if (unit->race != race) |
| 758 | continue; |
| 759 | |
| 760 | if (isInappropriateUnit(unit)) |
| 761 | continue; |
| 762 | |
| 763 | w->PushButcherableUnit(unit); |
| 764 | } |
| 765 | return w; |
| 766 | } |
| 767 | |
| 768 | WatchedRace * checkRaceStocksProtected(color_ostream &out, int race) { |
| 769 | WatchedRace * w = new WatchedRace(out, race, true, 0, 0, 0, 0); |
no test coverage detected