MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / loadBattleVehicle

Function loadBattleVehicle

game/ui/tileview/cityview.cpp:109–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109std::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
134sp<Facility> findCurrentResearchFacility(sp<GameState> state, AgentType::Role role,
135 FacilityType::Capacity capacity)

Callers 1

initiateUfoMissionMethod · 0.70

Calls 1

threadPoolEnqueueMethod · 0.80

Tested by

no test coverage detected