| 26 | { |
| 27 | |
| 28 | std::shared_future<void> loadBattleBuilding(sp<GameState> state, sp<Building> building, |
| 29 | bool hotseat, bool raid, |
| 30 | std::list<StateRef<Agent>> playerAgents, |
| 31 | StateRef<Vehicle> playerVehicle) |
| 32 | { |
| 33 | auto loadTask = fw().threadPoolEnqueue( |
| 34 | [hotseat, building, state, raid, playerAgents, playerVehicle]() mutable -> void { |
| 35 | StateRef<Organisation> org = raid ? building->owner : state->getAliens(); |
| 36 | StateRef<Building> bld = {state.get(), building}; |
| 37 | |
| 38 | const std::map<StateRef<AgentType>, int> *aliens = nullptr; |
| 39 | const int *guards = nullptr; |
| 40 | const int *civilians = nullptr; |
| 41 | |
| 42 | Battle::beginBattle(*state, hotseat, org, playerAgents, aliens, guards, civilians, |
| 43 | playerVehicle, bld); |
| 44 | }); |
| 45 | return loadTask; |
| 46 | } |
| 47 | } // namespace |
| 48 | BuildingScreen::BuildingScreen(sp<GameState> state, sp<Building> building) |
| 49 | : Stage(), menuform(ui().getForm("city/building")), state(state), building(building) |
no test coverage detected