| 27 | } |
| 28 | |
| 29 | StateRef<Building> Organisation::pickRandomBuilding(GameState &state, StateRef<City> city) const |
| 30 | { |
| 31 | std::list<StateRef<Building>> ownedBuildingsList; |
| 32 | for (const auto &b : buildings) |
| 33 | { |
| 34 | if (b->city == city) |
| 35 | { |
| 36 | ownedBuildingsList.push_back(b); |
| 37 | } |
| 38 | } |
| 39 | return (ownedBuildingsList.empty()) ? nullptr : pickRandom(state.rng, ownedBuildingsList); |
| 40 | } |
| 41 | |
| 42 | void Organisation::takeOver(GameState &state, bool forced) |
| 43 | { |
no test coverage detected