示例#1
0
/*
 * Populate optional ter_id and furn_id variables
 */
void init_data_mappings() {
    set_ter_ids();
    set_furn_ids();
    set_oter_ids();
    set_trap_ids();
    calculate_mapgen_weights();
// temporary (reliable) kludge until switch statements are rewritten
    std::map<std::string, int> legacy_lookup;
    for(int i=0; i< num_legacy_ter;i++) {
         legacy_lookup[ legacy_ter_id[i] ] = i;
    }
    reverse_legacy_ter_id.clear();
    for( int i=0; i < terlist.size(); i++ ) {
        if ( legacy_lookup.find(terlist[i].id) != legacy_lookup.end() ) {
             reverse_legacy_ter_id[ i ] = legacy_lookup[ terlist[i].id ];
        } else {
             reverse_legacy_ter_id[ i ] = 0;
        }
    }
    legacy_lookup.clear();
    for(int i=0; i< num_legacy_furn;i++) {
         legacy_lookup[ legacy_furn_id[i] ] = i;
    }
    reverse_legacy_furn_id.clear();
    for( int i=0; i < furnlist.size(); i++ ) {
        if ( legacy_lookup.find(furnlist[i].id) != legacy_lookup.end() ) {
             reverse_legacy_furn_id[ i ] = legacy_lookup[ furnlist[i].id ];
        } else {
             reverse_legacy_furn_id[ i ] = 0;
        }
    }
}
示例#2
0
void DynamicDataLoader::finalize_loaded_data()
{
    mission_type::initialize(); // Needs overmap terrain.
    set_ter_ids();
    set_furn_ids();
    set_oter_ids();
    trap::finalize();
    finalize_overmap_terrain();
    g->finalize_vehicles();
    calculate_mapgen_weights();
    MonsterGenerator::generator().finalize_mtypes();
    MonsterGenerator::generator().finalize_monfactions();
    MonsterGroupManager::FinalizeMonsterGroups();
    item_controller->finialize_item_blacklist();
    finalize_recipes();
    check_consistency();
}
示例#3
0
void DynamicDataLoader::finalize_loaded_data()
{
    item_controller->finalize();
    vpart_info::finalize();
    mission_type::initialize(); // Needs overmap terrain.
    set_ter_ids();
    set_furn_ids();
    set_oter_ids();
    trap::finalize();
    finalize_overmap_terrain();
    vehicle_prototype::finalize();
    calculate_mapgen_weights();
    MonsterGenerator::generator().finalize_mtypes();
    MonsterGroupManager::FinalizeMonsterGroups();
    monfactions::finalize();
    finalize_recipes();
    finialize_martial_arts();
    finalize_constructions();
    check_consistency();
}