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