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

Method createAgent

game/state/shared/agent.cpp:62–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62StateRef<Agent> AgentGenerator::createAgent(GameState &state, StateRef<Organisation> org,
63 AgentType::Role role) const
64{
65 std::list<sp<AgentType>> types;
66 for (auto &t : state.agent_types)
67 if (t.second->role == role && t.second->playable)
68 types.insert(types.begin(), t.second);
69 auto type = pickRandom(state.rng, types);
70
71 return createAgent(state, org, {&state, AgentType::getId(state, type)});
72}
73
74StateRef<Agent> AgentGenerator::createAgent(GameState &state, StateRef<Organisation> org,
75 StateRef<AgentType> type) const

Callers 7

createBattleMethod · 0.80
battlemap.cppFile · 0.80
updateHirableAgentsMethod · 0.80
spawnUnitMethod · 0.80
goToBattleMethod · 0.80

Calls 15

pickRandomFunction · 0.85
probabilityMapRandomizerFunction · 0.85
formatFunction · 0.85
randBoundsExclusiveFunction · 0.85
randBoundsInclusiveFunction · 0.85
insertMethod · 0.80
endMethod · 0.80
setSpeedMethod · 0.80
getPlayerMethod · 0.80
getAliensMethod · 0.80
generateEquipmentListMethod · 0.80
getCivilianMethod · 0.80

Tested by

no test coverage detected