Пример #1
0
void MonsterGroupManager::FinalizeMonsterGroups()
{
    const MonsterGenerator &gen = MonsterGenerator::generator();
    for(t_string_set::const_iterator a = monster_whitelist.begin(); a != monster_whitelist.end(); a++) {
        if (!gen.has_mtype(*a)) {
            debugmsg("monster on whitelist %s does not exist", a->c_str());
        }
    }
    for(t_string_set::const_iterator a = monster_blacklist.begin(); a != monster_blacklist.end(); a++) {
        if (!gen.has_mtype(*a)) {
            debugmsg("monster on blacklist %s does not exist", a->c_str());
        }
    }
    for(std::map<std::string, MonsterGroup>::iterator b = monsterGroupMap.begin(); b != monsterGroupMap.end(); ++b) {
        MonsterGroup &mg = b->second;
        for(FreqDef::iterator c = mg.monsters.begin(); c != mg.monsters.end(); ) {
            if(monster_is_blacklisted(gen.GetMType(c->name))) {
                c = mg.monsters.erase(c);
            } else {
                ++c;
            }
        }
        if(monster_is_blacklisted(gen.GetMType(mg.defaultMonster))) {
            mg.defaultMonster = "mon_null";
        }
    }
    monster_blacklist.clear();
    monster_whitelist.clear();
    monster_categories_blacklist.clear();
    monster_categories_whitelist.clear();
}
Пример #2
0
void MonsterGroupManager::ClearMonsterGroups()
{
    monsterGroupMap.clear();
    monster_blacklist.clear();
    monster_whitelist.clear();
    monster_categories_blacklist.clear();
    monster_categories_whitelist.clear();
}