1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include <iostream>
#include <string>
#include <unordered_map>
// either an enum
enum class Types {
NOTYPE, // placeholder for if a second type doesn't exist
Water,
Fire,
Grass,
// ...
};
// or a set
struct PokemonData {
int hp;
int attack;
int defense;
int spatk;
int spdef;
int speed;
Types type1;
Types type2;
};
const std::unordered_map<std::string, PokemonData> Pokemon = {
{"charmander", {39, 52, 43, 60, 50, 65, Types::Fire, Types::NOTYPE}},
{"squirtle", {44, 48, 65, 50, 64, 43, Types::Water, Types::NOTYPE}},
{"pidgey", {40, 45, 40, 35, 35, 56, Types::Normal, Types::Flying}},
{"ekans", {35, 60, 44, 40, 54, 55, Types::Poison, Types::NOTYPE}},
// so on
};
int main() {
// ...
}
|