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

Function loadBattleBuilding

game/ui/tileview/cityview.cpp:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86{
87
88std::shared_future<void> loadBattleBuilding(sp<GameState> state, sp<Building> building,
89 bool hotseat, bool raid,
90 std::list<StateRef<Agent>> playerAgents,
91 StateRef<Vehicle> playerVehicle)
92{
93 auto loadTask = fw().threadPoolEnqueue(
94 [hotseat, building, state, raid, playerAgents, playerVehicle]() mutable -> void
95 {
96 StateRef<Organisation> org = raid ? building->owner : state->getAliens();
97 StateRef<Building> bld = {state.get(), building};
98
99 const std::map<StateRef<AgentType>, int> *aliens = nullptr;
100 const int *guards = nullptr;
101 const int *civilians = nullptr;
102
103 Battle::beginBattle(*state, hotseat, org, playerAgents, aliens, guards, civilians,
104 playerVehicle, bld);
105 });
106 return loadTask;
107}
108
109std::shared_future<void> loadBattleVehicle(sp<GameState> state, StateRef<Vehicle> ufo,
110 StateRef<Vehicle> playerVehicle)

Callers 1

Calls 3

threadPoolEnqueueMethod · 0.80
getAliensMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected