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

Function loadBattleBuilding

game/ui/city/buildingscreen.cpp:28–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26{
27
28std::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
48BuildingScreen::BuildingScreen(sp<GameState> state, sp<Building> building)
49 : Stage(), menuform(ui().getForm("city/building")), state(state), building(building)

Callers 1

eventOccurredMethod · 0.70

Calls 3

threadPoolEnqueueMethod · 0.80
getAliensMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected