* Get the list of RuleManufacture which can be manufacture in a Base. * @param productions the list of Productions which are available. * @param ruleset the Game Ruleset * @param base a pointer to a Base */
| 1054 | * @param base a pointer to a Base |
| 1055 | */ |
| 1056 | void SavedGame::getAvailableProductions (std::vector<RuleManufacture *> & productions, const Ruleset * ruleset, Base * base) const |
| 1057 | { |
| 1058 | const std::vector<std::string> &items = ruleset->getManufactureList (); |
| 1059 | const std::vector<Production *> baseProductions (base->getProductions ()); |
| 1060 | |
| 1061 | for(std::vector<std::string>::const_iterator iter = items.begin (); |
| 1062 | iter != items.end (); |
| 1063 | ++iter) |
| 1064 | { |
| 1065 | RuleManufacture *m = ruleset->getManufacture(*iter); |
| 1066 | if(!isResearched(m->getRequirements())) |
| 1067 | { |
| 1068 | continue; |
| 1069 | } |
| 1070 | if(std::find_if(baseProductions.begin (), baseProductions.end (), equalProduction(m)) != baseProductions.end ()) |
| 1071 | { |
| 1072 | continue; |
| 1073 | } |
| 1074 | productions.push_back(m); |
| 1075 | } |
| 1076 | } |
| 1077 | |
| 1078 | /** |
| 1079 | * Check whether a ResearchProject can be researched. |
no test coverage detected