MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / chooseRandomRegion

Method chooseRandomRegion

src/Savegame/AlienStrategy.cpp:119–129  ·  view source on GitHub ↗

* Choose one of the regions for a mission. * @param rules Pointer to the ruleset. * @return The region id. */

Source from the content-addressed store, hash-verified

117 * @return The region id.
118 */
119const std::string AlienStrategy::chooseRandomRegion(const Ruleset *rules)
120{
121 std::string chosen = _regionChances.choose();
122 if (chosen == "")
123 {
124 init(rules);
125 chosen = _regionChances.choose();
126 }
127 assert ("" != chosen);
128 return chosen;
129}
130
131/**
132 * Choose one missions available for @a region.

Callers 1

Calls 2

initFunction · 0.85
chooseMethod · 0.80

Tested by

no test coverage detected