| 107 | } |
| 108 | |
| 109 | std::shared_future<void> loadBattleVehicle(sp<GameState> state, StateRef<Vehicle> ufo, |
| 110 | StateRef<Vehicle> playerVehicle) |
| 111 | { |
| 112 | |
| 113 | auto loadTask = fw().threadPoolEnqueue( |
| 114 | [state, ufo, playerVehicle]() -> void |
| 115 | { |
| 116 | std::list<StateRef<Agent>> agents; |
| 117 | for (auto &a : playerVehicle->currentAgents) |
| 118 | { |
| 119 | if (a->type->role == AgentType::Role::Soldier) |
| 120 | { |
| 121 | agents.push_back(a); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | StateRef<Organisation> org = ufo->owner; |
| 126 | bool hotseat = false; |
| 127 | const std::map<StateRef<AgentType>, int> *aliens = nullptr; |
| 128 | Battle::beginBattle(*state, hotseat, org, agents, aliens, playerVehicle, ufo); |
| 129 | }); |
| 130 | |
| 131 | return loadTask; |
| 132 | } |
| 133 | |
| 134 | sp<Facility> findCurrentResearchFacility(sp<GameState> state, AgentType::Role role, |
| 135 | FacilityType::Capacity capacity) |
no test coverage detected