bool statistics(std::map<std::string, ValueRef::ValueRefBase<double>*>& stats_) { bool result = true; for (const boost::filesystem::path& file : ListScripts("scripting/empire_statistics")) { result &= detail::parse_file<rules, std::map<std::string, ValueRef::ValueRefBase<double>*> >(file, stats_); } return result; }
bool ship_parts(std::map<std::string, PartType*>& parts) { bool result = true; for(const boost::filesystem::path& file : ListScripts("scripting/ship_parts")) { result &= detail::parse_file<rules, std::map<std::string, PartType*>>(file, parts); } return result; }
start_rule_payload ship_hulls(const boost::filesystem::path& path) { const lexer lexer; start_rule_payload hulls; for (const boost::filesystem::path& file : ListScripts(path)) { /*auto success =*/ detail::parse_file<grammar, start_rule_payload>(lexer, file, hulls); } return hulls; }
bool ship_hulls(std::map<std::string, HullType*>& hulls) { bool result = true; std::vector<boost::filesystem::path> file_list = ListScripts("scripting/ship_hulls"); for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin(); file_it != file_list.end(); ++file_it) { result &= detail::parse_file<rules, std::map<std::string, HullType*> >(*file_it, hulls); } return result; }
bool specials(std::map<std::string, Special*>& specials_) { bool result = true; std::vector<boost::filesystem::path> file_list = ListScripts("scripting/specials"); for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin(); file_it != file_list.end(); ++file_it) { result &= detail::parse_file<rules, std::map<std::string, Special*> >(*file_it, specials_); } return result; }
bool statistics(std::map<std::string, ValueRef::ValueRefBase<double>*>& stats_) { bool result = true; std::vector<boost::filesystem::path> file_list = ListScripts("scripting/empire_statistics"); for (std::vector<boost::filesystem::path>::iterator file_it = file_list.begin(); file_it != file_list.end(); ++file_it) { result &= detail::parse_file<rules, std::map<std::string, ValueRef::ValueRefBase<double>*> >(*file_it, stats_); } return result; }
start_rule_payload statistics(const boost::filesystem::path& path) { const lexer lexer; start_rule_payload all_stats; for (const boost::filesystem::path& file : ListScripts(path)) { start_rule_payload stats_; if (/*auto success =*/ detail::parse_file<grammar, start_rule_payload>(lexer, file, stats_)) { for (auto&& stat : stats_) { auto maybe_inserted = all_stats.emplace(stat.first, std::move(stat.second)); if (!maybe_inserted.second) { WarnLogger() << "Addition of second statistic with name " << maybe_inserted.first->first << " failed. Keeping first statistic found."; } } } } return all_stats; }
static int List( addons_finder_t *p_finder ) { addon_type_t types[] = { ADDON_EXTENSION, ADDON_PLAYLIST_PARSER, ADDON_SERVICE_DISCOVERY }; unsigned int i_type = 0; LoadCatalog( p_finder ); /* Browse dirs to find rogue files */ while( i_type < ARRAY_SIZE( types ) ) { ListScripts( p_finder, types[i_type++] ); } ListSkins( p_finder ); return VLC_SUCCESS; }