示例#1
0
void NetworkModel::add_species(const Species& sp)
{
    if (has_species(sp))
    {
        throw AlreadyExists("species already exists");
    }
    species_.push_back(sp);
    dirty_ = true;
}
void MonsterGenerator::check_monster_definitions() const
{
    for(std::map<std::string, mtype *>::const_iterator a = mon_templates.begin();
        a != mon_templates.end(); ++a) {
        const mtype *mon = a->second;
        for(std::set<std::string>::iterator spec = mon->species.begin(); spec != mon->species.end();
            ++spec) {
            if(!has_species(*spec)) {
                debugmsg("monster %s has invalid species %s", mon->id.c_str(), spec->c_str());
            }
        }
    }
}
void MonsterGenerator::check_monster_definitions() const
{
    for(std::map<std::string, mtype *>::const_iterator a = mon_templates.begin();
        a != mon_templates.end(); ++a) {
        const mtype *mon = a->second;
        for(std::set<std::string>::iterator spec = mon->species.begin(); spec != mon->species.end();
            ++spec) {
            if(!has_species(*spec)) {
                debugmsg("monster %s has invalid species %s", mon->id.c_str(), spec->c_str());
            }
        }
        if (!mon->death_drops.empty() && !item_controller->has_group(mon->death_drops)) {
            debugmsg("monster %s has unknown death drop item group: %s", mon->id.c_str(),
                     mon->death_drops.c_str());
        }
    }
}
示例#4
0
void MonsterGenerator::check_monster_definitions() const
{
    for( const auto &elem : mon_templates ) {
        const mtype *mon = elem.second;
        for(std::set<std::string>::iterator spec = mon->species.begin(); spec != mon->species.end();
            ++spec) {
            if(!has_species(*spec)) {
                debugmsg("monster %s has invalid species %s", mon->id.c_str(), spec->c_str());
            }
        }
        if (!mon->death_drops.empty() && !item_group::group_is_defined(mon->death_drops)) {
            debugmsg("monster %s has unknown death drop item group: %s", mon->id.c_str(),
                     mon->death_drops.c_str());
        }
        if( !mon->revert_to_itype.empty() && !item::type_is_defined( mon->revert_to_itype ) ) {
            debugmsg("monster %s has unknown revert_to_itype: %s", mon->id.c_str(),
                     mon->revert_to_itype.c_str());
        }
    }
}