<commit_before>/*
 * Copyright (c) 2013 <NAME> (<EMAIL>)
 *
 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 * or copy at http://opensource.org/licenses/MIT)
 */
#include <string>
#include <vector>

#include <boost/assign.hpp>

#include <pkmnsim/base_pkmn.hpp>
#include <pkmnsim/dict.hpp>

#include "type_stats_common.hpp"

using namespace pkmnsim;
using namespace std;

//The values are what the base_pkmn subclasses return in get_base_stats()
dict<string, string> get_stat_map(void)
{
    dict<string, string> stat_map = boost::assign::map_list_of
        ("HP","HP")
        ("Attack","ATK")
        ("Defense","DEF")
        ("Special Attack","SATK")
        ("Special Defense","SDEF")
        ("Special","SPCL")
        ("Speed","SPD");

    return stat_map;
}

void remove_unevolved_pokemon(vector<base_pkmn::sptr>& pkmn_vector)
{
    vector<int> to_erase; //Gathering vector indices to erase

    for(unsigned int i = 0; i < pkmn_vector.size(); i++)
    {
        if(not pkmn_vector[i]->is_fully_evolved())
        {
            to_erase.push_back(i);
        }
    }

    for(unsigned int j = to_erase.size()-1; j >= 0; j--)
    {
        pkmn_vector.erase(pkmn_vector.begin() + to_erase[j]);
    }
}

int sort_pokemon_by_stats(string type1, string type2, vector<stat_st>& highest_stats,
                           vector<stat_st>& lowest_stats, int gen, bool lax, bool evolved)
{
    highest_stats.clear();
    lowest_stats.clear();

    highest_stats.push_back(stat_st("HP"));
    highest_stats.push_back(stat_st("Attack"));
    highest_stats.push_back(stat_st("Defense"));
    highest_stats.push_back(stat_st("Speed"));
    if(gen == 1) highest_stats.push_back(stat_st("Special"));
    else
    {
        highest_stats.push_back(stat_st("Special Attack"));
        highest_stats.push_back(stat_st("Special Defense"));
    }
    lowest_stats = highest_stats;
    vector<base_pkmn::sptr> pkmn_vector;

    //Get relevant Pokémon and determine validity of options<commit_msg>get_type_stats: fixed segfault introduced by removal of implicit casts<commit_after>/*
 * Copyright (c) 2013 <NAME> (<EMAIL>)
 *
 * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 * or copy at http://opensource.org/licenses/MIT)
 */
#include <string>
#include <vector>

#include <boost/assign.hpp>

#include <pkmnsim/base_pkmn.hpp>
#include <pkmnsim/dict.hpp>

#include "type_stats_common.hpp"

using namespace pkmnsim;
using namespace std;

//The values are what the base_pkmn subclasses return in get_base_stats()
dict<string, string> get_stat_map(void)
{
    dict<string, string> stat_map = boost::assign::map_list_of
        ("HP","HP")
        ("Attack","ATK")
        ("Defense","DEF")
        ("Special Attack","SATK")
        ("Special Defense","SDEF")
        ("Special","SPCL")
        ("Speed","SPD");

    return stat_map;
}

void remove_unevolved_pokemon(vector<base_pkmn::sptr>& pkmn_vector)
{
    vector<int> to_erase; //Gathering vector indices to erase

    for(int i = 0; i < pkmn_vector.size(); i++)
    {
        if(not pkmn_vector[i]->is_fully_evolved())
        {
            to_erase.push_back(i);
        }
    }

    for(int j = to_erase.size()-1; j >= 0; j--)
    {
        pkmn_vector.erase(pkmn_vector.begin() + to_erase[j]);
    }
}

int sort_pokemon_by_stats(string type1, string type2, vector<stat_st>& highest_stats,
                           vector<stat_st>& lowest_stats, int gen, bool lax, bool evolved)
{
    highest_stats.clear();
    lowest_stats.clear();

    highest_stats.push_back(stat_st("HP"));
    highest_stats.push_back(stat_st("Attack"));
    highest_stats.push_back(stat_st("Defense"));
    highest_stats.push_back(stat_st("Speed"));
    if(gen == 1) highest_stats.push_back(stat_st("Special"));
    else
    {
        highest_stats.push_back(stat_st("Special Attack"));
        highest_stats.push_back(stat_st("Special Defense"));
    }
    lowest_stats = highest_stats;
    vector<base_pkmn::sptr> pkmn_vector;

    //Get relevant Pokémon and determine validity of options
{'fraction_non_alphanumeric': 0.14145141451414514, 'fraction_numerical': 0.004920049200492005, 'mean_word_length': 3.502768549280177, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4143629', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1394, 'n_words': 277}