bool ma_requirements::is_valid_weapon(item& i) { for (std::set<std::string>::iterator it = req_flags.begin(); it != req_flags.end(); ++it) { std::string flag = *it; if (!i.has_flag(flag)) return false; } bool valid = i.damage_bash() >= min_bashing_damage && i.damage_cut() >= min_cutting_damage; return valid; }
bool ma_requirements::is_valid_weapon(item &i) { for( auto flag : req_flags ) { if (!i.has_flag(flag)) { return false; } } bool valid = i.damage_bash() >= min_bashing_damage && i.damage_cut() >= min_cutting_damage; return valid; }