15 std::map<std::string, std::vector<std::string> >
addToRace;
16 std::map<std::string, std::vector<object *> >
races;
27 LOG(
llevError,
"races_get_random_monster: requested non-existent aligned race %s!\n", race);
31 std::vector<object *> valid;
32 for (
auto it = (*r).second.begin(); it != (*r).second.end(); it++) {
33 if ((*it)->level <=
level) {
40 return valid[
rndm(0, valid.size() - 1)];
59 if (sscanf(cp,
"RACE %s", variable)) {
60 strcpy(race, variable);
65 for (cp1 = cp; *cp1 ==
' '; cp1++)
68 for (cp1 = cp+strlen(cp)-1; *cp1 ==
' '; cp1--) {
84 for (
auto race =
races.cbegin(); race !=
races.cend(); race++) {
85 fprintf(stderr,
"\nRACE %s:\t", (*race).first.c_str());
86 for (
auto mon = (*race).second.cbegin();
mon != (*race).second.cend();
mon++) {
87 fprintf(stderr,
"%s (%d), ", (*mon)->arch->name, (*mon)->level);
102 for (
const auto&
name : add.second) {
105 races[add.first].push_back(&
mon->clone);
107 LOG(
llevError,
"races: %s %s\n",
name.c_str(),
mon ?
"is not a monster" :
"does not exist");