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

Method PopulateBuildList

src/Basescape/BuildFacilitiesState.cpp:100–114  ·  view source on GitHub ↗

* Populates the build list from the current "available" facilities. */

Source from the content-addressed store, hash-verified

98 * Populates the build list from the current "available" facilities.
99 */
100void BuildFacilitiesState::PopulateBuildList()
101{
102 const std::vector<std::string> &facilities = _game->getRuleset()->getBaseFacilitiesList();
103 for (std::vector<std::string>::const_iterator i = facilities.begin(); i != facilities.end(); ++i)
104 {
105 RuleBaseFacility *rule = _game->getRuleset()->getBaseFacility(*i);
106 if (_game->getSavedGame()->isResearched(rule->getRequirements()) && !rule->isLift())
107 _facilities.push_back(rule);
108 }
109
110 for (std::vector<RuleBaseFacility*>::iterator i = _facilities.begin(); i != _facilities.end(); ++i)
111 {
112 _lstFacilities->addRow(1, tr((*i)->getType()).c_str());
113 }
114}
115
116/**
117 * The player can change the selected base

Callers

nothing calls this directly

Calls 7

getBaseFacilityMethod · 0.80
isResearchedMethod · 0.80
getSavedGameMethod · 0.80
isLiftMethod · 0.80
addRowMethod · 0.80
getRulesetMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected